code: def present(name, auth=None, **kwargs):
      '''
      Ensure an role exists
  
      name
          Name of the role
  
      description
          An arbitrary description of the role
      '''
      ret = {'name': name,
             'changes': {},
             'result': True,
             'comment': ''}
  
      kwargs = __utils__['args.clean_kwargs'](**kwargs)
  
      __salt__['keystoneng.setup_clouds'](auth)
  
      kwargs['name'] = name
      role = __salt__['keystoneng.role_get'](**kwargs)
  
      if not role:
          if __opts__['test'] is True:
              ret['result'] = None
              ret['changes'] = kwargs
              ret['comment'] = 'Role will be created.'
              return ret
  
          role = __salt__['keystoneng.role_create'](**kwargs)
          ret['changes']['id'] = role.id
          ret['changes']['name'] = role.name
          ret['comment'] = 'Created role'
          return ret
      # NOTE(SamYaple): Update support pending https://review.openstack.org/#/c/496992/
      return ref present(name, auth=None, **kwargs):
      '''
      Ensure an role exists
  
      name
          Name of the role
  
      description
          An arbitrary description of the role
      '''
      ret = {'name': name,
             'changes': {},
             'result': True,
             'comment': ''}
  
      kwargs = __utils__['args.clean_kwargs'](**kwargs)
  
      __salt__['keystoneng.setup_clouds'](auth)
  
      kwargs['name'] = name
      role = __salt__['keystoneng.role_get'](**kwargs)
  
      if not role:
          if __opts__['test'] is True:
              ret['result'] = None
              ret['changes'] = kwargs
              ret['comment'] = 'Role will be created.'
              return ret
  
          role = __salt__['keystoneng.role_create'](**kwargs)
          ret['changes']['id'] = role.id
          ret['changes']['name'] = role.name
          ret['comment'] = 'Created role'
          return ret
      # NOTE(SamYaple): Update support pending https://review.openstack.org/#/c/496992/
      return ret
docs: Ensure an role exists
  
      name
          Name of the role
  
      description
          An arbitrary description of the role