def role_present(name, profile=None, **connection_args):
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Role "{0}" already exists'.format(name)}

    # Check if role is already present
    role = __salt__['keystone.role_get'](name=name, profile=profile,
                                         **connection_args)

    if 'Error' not in role:
        return ret
    else:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'Role "{0}" will be added'.format(name)
            ret['changes']['Role'] = 'Will be created'
            return ret
        # Create role
        __salt__['keystone.role_create'](name, profile=profile,
                                         **connection_args)
        ret['comment'] = 'Role "{0}" has been added'.format(name)
        ret['changes']['Role'] = 'Created'
    return ret
Return dict of uncommented global variables.
dataset/ETHPy150Open saltstack/salt/salt/states/keystone.py/role_present--crossover with--dataset/ETHPy150Open saltstack/salt/salt/modules/pkgng.py/parse_config