From 806ff5c1a37813d008a29c7de88746e2082e4e8a Mon Sep 17 00:00:00 2001 From: MubashirUsman Date: Sun, 19 May 2024 13:54:43 +0200 Subject: [PATCH] added sysctl_dirs variable and system_wide var --- plugins/modules/sysctl.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/modules/sysctl.py b/plugins/modules/sysctl.py index 7914e9d..de75291 100644 --- a/plugins/modules/sysctl.py +++ b/plugins/modules/sysctl.py @@ -114,12 +114,24 @@ class SysctlModule(object): # success or failure. LANG_ENV = {'LANG': 'C', 'LC_ALL': 'C', 'LC_MESSAGES': 'C'} + # We define a variable to keep all the directories to be read, equivalent to + # (/sbin/sysctl --system) option + SYSCTL_DIRS = [ + '/etc/sysctl.d/*.conf', + '/run/sysctl.d/*.conf', + '/usr/local/lib/sysctl.d/*.conf', + '/usr/lib/sysctl.d/*.conf', + '/lib/sysctl.d/*.conf', + '/etc/sysctl.conf' + ] + def __init__(self, module): self.module = module self.args = self.module.params self.sysctl_cmd = self.module.get_bin_path('sysctl', required=True) self.sysctl_file = self.args['sysctl_file'] + self.system_Wide = self.args['system_Wide'] self.proc_value = None # current token value in proc fs self.file_value = None # current token value in file