Commit cf0a0ca3 by James Tanner

Fixes #6519 Properly handle state=absent in sysctl module

parent db3d2e10
...@@ -144,9 +144,13 @@ class SysctlModule(object): ...@@ -144,9 +144,13 @@ class SysctlModule(object):
if self.file_values[thisname] is None and self.args['state'] == "present": if self.file_values[thisname] is None and self.args['state'] == "present":
self.changed = True self.changed = True
self.write_file = True self.write_file = True
elif self.file_values[thisname] is None and self.args['state'] == "absent":
self.changed = False
elif self.file_values[thisname] != self.args['value']: elif self.file_values[thisname] != self.args['value']:
self.changed = True self.changed = True
self.write_file = True self.write_file = True
# use the sysctl command or not?
if self.args['sysctl_set']: if self.args['sysctl_set']:
if self.proc_value is None: if self.proc_value is None:
self.changed = True self.changed = True
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment