def set_dnsmasq_facts_if_unset(facts):
 if ('common' in facts):
  if ('use_dnsmasq' not in facts['common']):
   facts['common']['use_dnsmasq'] = bool(safe_get_bool(facts['common']['version_gte_3_2_or_1_2']))
  if (('master' in facts) and ('dns_port' not in facts['master'])):
   if safe_get_bool(facts['common']['use_dnsmasq']):
    facts['master']['dns_port'] = 8053
   else:
    facts['master']['dns_port'] = 53
 return facts

def set_dnsmasq_facts_if_unset ( facts ) : if ( 'common' in facts ) : if ( 'use_dnsmasq' not in facts [ 'common' ] ) : facts [ 'common' ] [ 'use_dnsmasq' ] = bool ( safe_get_bool ( facts [ 'common' ] [ 'version_gte_3_2_or_1_2' ] ) ) if ( ( 'master' in facts ) and ( 'dns_port' not in facts [ 'master' ] ) ) : if safe_get_bool ( facts [ 'common' ] [ 'use_dnsmasq' ] ) : facts [ 'master' ] [ 'dns_port' ] = 8053 else : facts [ 'master' ] [ 'dns_port' ] = 53 return facts
set dnsmasq facts if not already present in facts args: facts existing facts returns: facts updated facts with values set if not previously set .