mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-05-07 05:43:04 +00:00
do not persist sysctl when value is invalid
the order of actions for setting, persisting and activation is changed, to not persist an invalid sysctl value. This is only enforced when sysct_set is True.
This commit is contained in:
@@ -182,12 +182,12 @@ class SysctlModule(object):
|
||||
|
||||
# Do the work
|
||||
if not self.module.check_mode:
|
||||
if self.set_proc:
|
||||
self.set_token_value(self.args['name'], self.args['value'])
|
||||
if self.write_file:
|
||||
self.write_sysctl()
|
||||
if self.changed and self.args['reload']:
|
||||
self.reload_sysctl()
|
||||
if self.set_proc:
|
||||
self.set_token_value(self.args['name'], self.args['value'])
|
||||
|
||||
def _values_is_equal(self, a, b):
|
||||
"""Expects two string values. It will split the string by whitespace
|
||||
|
||||
Reference in New Issue
Block a user