'Get default fact values
Args:
roles (list): list of roles for this host
Returns:
dict: The generated default facts'

def get_defaults(self, roles, deployment_type, deployment_subtype):

    defaults = {}
    ip_addr = self.system_facts['ansible_default_ipv4']['address']
    (exit_code, output, _) = module.run_command(['hostname', '-f'])
    hostname_f = (output.strip() if (exit_code == 0) else '')
    hostname_values = [hostname_f, self.system_facts['ansible_nodename'], self.system_facts['ansible_fqdn']]
    hostname = choose_hostname(hostname_values, ip_addr)
    defaults['common'] = dict(use_openshift_sdn=True, ip=ip_addr, public_ip=ip_addr, deployment_type=deployment_type, deployment_subtype=deployment_subtype, hostname=hostname, public_hostname=hostname, portal_net='172.30.0.0/16', client_binary='oc', admin_binary='oadm', dns_domain='cluster.local', install_examples=True, debug_level=2, config_base='/etc/origin', data_dir='/var/lib/origin')
    if ('master' in roles):
        defaults['master'] = dict(api_use_ssl=True, api_port='8443', controllers_port='8444', console_use_ssl=True, console_path='/console', console_port='8443', etcd_use_ssl=True, etcd_hosts='', etcd_port='4001', portal_net='172.30.0.0/16', embedded_etcd=True, embedded_kube=True, embedded_dns=True, bind_addr='0.0.0.0', session_max_seconds=3600, session_name='ssn', session_secrets_file='', access_token_max_seconds=86400, auth_token_max_seconds=500, oauth_grant_method='auto', dynamic_provisioning_enabled=True, max_requests_inflight=500)
    if ('node' in roles):
        defaults['node'] = dict(labels={}, annotations={}, iptables_sync_period='30s', local_quota_per_fsgroup='', set_node_ip=False)
    if ('docker' in roles):
        docker = dict(disable_push_dockerhub=False, options='--log-driver=journald')
        if (self.system_facts['ansible_pkg_mgr'] == 'dnf'):
            rpm_rebuilddb()
        version_info = get_docker_version_info()
        if (version_info is not None):
            docker['api_version'] = version_info['api_version']
            docker['version'] = version_info['version']
            docker['gte_1_10'] = (LooseVersion(version_info['version']) >= LooseVersion('1.10'))
        hosted_registry_insecure = get_hosted_registry_insecure()
        if (hosted_registry_insecure is not None):
            docker['hosted_registry_insecure'] = hosted_registry_insecure
        docker['service_name'] = 'docker'
        defaults['docker'] = docker
    if ('clock' in roles):
        (exit_code, _, _) = module.run_command(['rpm', '-q', 'chrony'])
        chrony_installed = bool((exit_code == 0))
        defaults['clock'] = dict(enabled=True, chrony_installed=chrony_installed)
    if ('cloudprovider' in roles):
        defaults['cloudprovider'] = dict(kind=None)
    if (('hosted' in roles) or (self.role == 'hosted')):
        defaults['hosted'] = dict(metrics=dict(deploy=False, duration=7, resolution='10s', storage=dict(kind=None, volume=dict(name='metrics', size='10Gi'), nfs=dict(directory='/exports', options='*(rw,root_squash)'), host=None, access=dict(modes=['ReadWriteOnce']), create_pv=True, create_pvc=False)), loggingops=dict(storage=dict(kind=None, volume=dict(name='logging-es-ops', size='10Gi'), nfs=dict(directory='/exports', options='*(rw,root_squash)'), host=None, access=dict(modes=['ReadWriteOnce']), create_pv=True, create_pvc=False)), logging=dict(storage=dict(kind=None, volume=dict(name='logging-es', size='10Gi'), nfs=dict(directory='/exports', options='*(rw,root_squash)'), host=None, access=dict(modes=['ReadWriteOnce']), create_pv=True, create_pvc=False)), etcd=dict(storage=dict(kind=None, volume=dict(name='etcd', size='1Gi'), nfs=dict(directory='/exports', options='*(rw,root_squash)'), host=None, access=dict(modes=['ReadWriteOnce']), create_pv=True, create_pvc=False)), registry=dict(storage=dict(kind=None, volume=dict(name='registry', size='5Gi'), nfs=dict(directory='/exports', options='*(rw,root_squash)'), glusterfs=dict(endpoints='glusterfs-registry-endpoints', path='glusterfs-registry-volume', readOnly=False, swap=False, swapcopy=True), host=None, access=dict(modes=['ReadWriteMany']), create_pv=True, create_pvc=True)), router=dict())
    return defaults
