

def boolean(name, value, persist=False):
    '\n    Set up an SELinux boolean\n\n    name\n        The name of the boolean to set\n\n    value\n        The value to set on the boolean\n\n    persist\n        Defaults to False, set persist to true to make the boolean apply on a\n        reboot\n    '
    ret = {
        'name': name,
        'result': True,
        'comment': '',
        'changes': {
            
        },
    }
    bools = __salt__['selinux.list_sebool']()
    if (name not in bools):
        ret['comment'] = 'Boolean {0} is not available'.format(name)
        ret['result'] = False
        return ret
    rvalue = _refine_value(value)
    if (rvalue is None):
        bools['comment'] = '{0} is not a valid value for the boolean'.format(value)
        ret['result'] = False
        return ret
    state = (bools[name]['State'] == rvalue)
    default = (bools[name]['Default'] == rvalue)
    if persist:
        if (state and default):
            ret['comment'] = 'Boolean is in the correct state'
            return ret
    elif state:
        ret['comment'] = 'Boolean is in the correct state'
        return ret
    if __opts__['test']:
        ret['result'] = None
        ret['comment'] = 'Boolean {0} is set to be changed to {1}'.format(name, rvalue)
        return ret
    if __salt__['selinux.setsebool'](name, rvalue, persist):
        ret['comment'] = 'Boolean {0} has been set to {1}'.format(name, rvalue)
        return ret
    ret['comment'] = 'Failed to set the boolean {0} to {1}'.format(name, rvalue)
    return ret

dataset/ETHPy150Open saltstack/salt/salt/states/selinux.py boolean/VarMisuse@105/252 `ret`->`bools`