mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
sysctl module: fail if reloading the file did not succeed
This commit is contained in:
parent
671b0454c6
commit
17c50cc81e
1 changed files with 3 additions and 2 deletions
|
@ -190,7 +190,8 @@ class SysctlModule(object):
|
||||||
# system supports reloading via the -p flag to sysctl, so we'll use that
|
# system supports reloading via the -p flag to sysctl, so we'll use that
|
||||||
rc,out,err = self.module.run_command([self.sysctl_cmd, '-p', self.sysctl_file])
|
rc,out,err = self.module.run_command([self.sysctl_cmd, '-p', self.sysctl_file])
|
||||||
|
|
||||||
return rc,out+err
|
if rc != 0:
|
||||||
|
self.module.fail_json(msg="Failed to reload sysctl: %s" % str(out) + str(err))
|
||||||
|
|
||||||
# ==============================================================
|
# ==============================================================
|
||||||
# SYSCTL FILE MANAGEMENT
|
# SYSCTL FILE MANAGEMENT
|
||||||
|
|
Loading…
Reference in a new issue