mirror of
https://github.com/ansible-collections/ansible.posix.git
synced 2026-06-09 18:15:54 +00:00
3
changelogs/fragments/freebsd_sysctl.yml
Normal file
3
changelogs/fragments/freebsd_sysctl.yml
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- sysctl - reload sysctl only if the sysctl file is ``/etc/sysctl.conf`` or ``/etc/sysctl.conf.local`` (https://github.com/ansible-collections/ansible.posix/issues/663).
|
||||||
@@ -44,6 +44,7 @@ options:
|
|||||||
- If V(true), performs a C(/sbin/sysctl -p) if the O(sysctl_file) is
|
- If V(true), performs a C(/sbin/sysctl -p) if the O(sysctl_file) is
|
||||||
updated. If V(false), does not reload C(sysctl) even if the
|
updated. If V(false), does not reload C(sysctl) even if the
|
||||||
O(sysctl_file) is updated.
|
O(sysctl_file) is updated.
|
||||||
|
- For FreeBSD, can not be used with O(sysctl_file) other than C(/etc/sysctl.conf) or C(/etc/sysctl.conf.local).
|
||||||
type: bool
|
type: bool
|
||||||
default: true
|
default: true
|
||||||
sysctl_file:
|
sysctl_file:
|
||||||
@@ -166,6 +167,11 @@ class SysctlModule(object):
|
|||||||
|
|
||||||
self.platform = platform.system().lower()
|
self.platform = platform.system().lower()
|
||||||
|
|
||||||
|
# system specific tests
|
||||||
|
freebsd_sysctl_files = ['/etc/sysctl.conf', '/etc/sysctl.conf.local']
|
||||||
|
if self.platform == 'freebsd' and self.sysctl_file not in freebsd_sysctl_files and self.args['reload']:
|
||||||
|
self.module.fail_json(msg="%s can not be reloaded. Set reload=False." % self.sysctl_file)
|
||||||
|
|
||||||
# Whitespace is bad
|
# Whitespace is bad
|
||||||
self.args['name'] = self.args['name'].strip()
|
self.args['name'] = self.args['name'].strip()
|
||||||
self.args['value'] = self._parse_value(self.args['value'])
|
self.args['value'] = self._parse_value(self.args['value'])
|
||||||
|
|||||||
Reference in New Issue
Block a user