Set selinux state to 'permissive' for state=disabled

pull/18777/head
kustodian 10 years ago committed by Matt Clay
parent 36c653f54a
commit 447c625cb3

@ -174,14 +174,19 @@ def main():
if (state != runtime_state): if (state != runtime_state):
if module.check_mode: if module.check_mode:
module.exit_json(changed=True) module.exit_json(changed=True)
if (state == 'disabled'): if (runtime_enabled):
msgs.append('state change will take effect next reboot') if (state == 'disabled'):
else: if (runtime_state != 'permissive'):
if (runtime_enabled): # Temporarily set state to permissive
set_state('permissive')
msgs.append('runtime state temporarily changed from \'%s\' to \'permissive\', state change will take effect next reboot' % (runtime_state))
else:
msgs.append('state change will take effect next reboot')
else:
set_state(state) set_state(state)
msgs.append('runtime state changed from \'%s\' to \'%s\'' % (runtime_state, state)) msgs.append('runtime state changed from \'%s\' to \'%s\'' % (runtime_state, state))
else: else:
msgs.append('state change will take effect next reboot') msgs.append('state change will take effect next reboot')
changed=True changed=True
if (state != config_state): if (state != config_state):

Loading…
Cancel
Save