def set_dnsmasq_facts_if_unset(facts):
    """ Set dnsmasq facts if not already present in facts
    Args:
        facts (dict) existing facts
    Returns:
        facts (dict) updated facts with values set if not previously set
    """

    if 'common' in facts:
        if 'use_dnsmasq' not in facts['common'] and facts['common']['version_gte_3_2_or_1_2']:
            facts['common']['use_dnsmasq'] = True
        else:
            facts['common']['use_dnsmasq'] = False
        if 'master' in facts and 'dns_port' not in facts['master']:
            if facts['common']['use_dnsmasq']:
                facts['master']['dns_port'] = 8053
            else:
                facts['master']['dns_port'] = 53

    return facts
dataset/ETHPy150Open openshift/openshift-ansible/roles/openshift_facts/library/openshift_facts.py/set_dnsmasq_facts_if_unset/original