mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-01-11 15:15:26 +01:00
Fix #663 - In FreeBSD, fail if loader.conf shall be reloaded.
This commit is contained in:
parent
d3204df536
commit
385a562148
1 changed files with 7 additions and 0 deletions
|
|
@ -418,6 +418,13 @@ def main():
|
||||||
if module.params['state'] == 'present' and module.params['value'] == '':
|
if module.params['state'] == 'present' and module.params['value'] == '':
|
||||||
module.fail_json(msg="value cannot be blank")
|
module.fail_json(msg="value cannot be blank")
|
||||||
|
|
||||||
|
# System specific tests
|
||||||
|
system = platform.system().lower()
|
||||||
|
if system == 'freebsd':
|
||||||
|
if module.params['sysctl_file'] not in ['/etc/sysctl.conf', '/etc/sysctl.conf.local'] and \
|
||||||
|
module.params['reload']:
|
||||||
|
module.fail_json(msg="%s can not be reloaded. Set reload=False." % module.params['sysctl_file'])
|
||||||
|
|
||||||
result = SysctlModule(module)
|
result = SysctlModule(module)
|
||||||
|
|
||||||
module.exit_json(changed=result.changed)
|
module.exit_json(changed=result.changed)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue