def set_identity_providers_if_unset(facts):
 if ('master' in facts):
  deployment_type = facts['common']['deployment_type']
  if ('identity_providers' not in facts['master']):
   identity_provider = dict(name='allow_all', challenge=True, login=True, kind='AllowAllPasswordIdentityProvider')
   if (deployment_type in ['enterprise', 'atomic-enterprise', 'openshift-enterprise']):
    identity_provider = dict(name='deny_all', challenge=True, login=True, kind='DenyAllPasswordIdentityProvider')
   facts['master']['identity_providers'] = [identity_provider]
 return facts

def set_identity_providers_if_unset ( facts ) : if ( 'master' in facts ) : deployment_type = facts [ 'common' ] [ 'deployment_type' ] if ( 'identity_providers' not in facts [ 'master' ] ) : identity_provider = dict ( name = 'allow_all' , challenge = True , login = True , kind = 'AllowAllPasswordIdentityProvider' ) if ( deployment_type in [ 'enterprise' , 'atomic-enterprise' , 'openshift-enterprise' ] ) : identity_provider = dict ( name = 'deny_all' , challenge = True , login = True , kind = 'DenyAllPasswordIdentityProvider' ) facts [ 'master' ] [ 'identity_providers' ] = [ identity_provider ] return facts
set identity_providers fact if not already present in facts dict args: facts : existing facts returns: dict: the facts dict updated with the generated identity providers facts if they were not already present .