diff --git a/shared/templates/sysctl/ansible.template b/shared/templates/sysctl/ansible.template index 4c2eade72e6..a393ae225e5 100644 --- a/shared/templates/sysctl/ansible.template +++ b/shared/templates/sysctl/ansible.template @@ -8,8 +8,10 @@ {{% if product in ["sle12","sle15"] %}} find: paths: - - "/etc/sysctl.d/" - "/run/sysctl.d/" + - "/etc/sysctl.d/" + - "/usr/local/lib/sysctl.d/" + - "/lib/sysctl.d/" {{% else %}} find: paths: diff --git a/shared/templates/sysctl/bash.template b/shared/templates/sysctl/bash.template index 49e4d949be0..21e52c369d7 100644 --- a/shared/templates/sysctl/bash.template +++ b/shared/templates/sysctl/bash.template @@ -6,7 +6,7 @@ # Comment out any occurrences of {{{ SYSCTLVAR }}} from /etc/sysctl.d/*.conf files {{% if product in [ "sle12", "sle15"] %}} -for f in /etc/sysctl.d/*.conf /run/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf; do +for f in /run/sysctl.d/*.conf /etc/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /lib/sysctl.d/*.conf; do {{% elif product not in [ "ol7", "ol8", "ol9", "rhcos4", "rhel7", "rhel8", "rhel9"] %}} for f in /etc/sysctl.d/*.conf /run/sysctl.d/*.conf /usr/local/lib/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf; do {{% else %}} diff --git a/shared/templates/sysctl/oval.template b/shared/templates/sysctl/oval.template index 988aee9f59c..d57f154e7c5 100644 --- a/shared/templates/sysctl/oval.template +++ b/shared/templates/sysctl/oval.template @@ -170,16 +170,24 @@ {{% endif %}} - - object_static_etc_sysctls_{{{ rule_id }}} + object_static_etc_lib_sysctls_{{{ rule_id }}} object_static_run_usr_local_sysctls_{{{ rule_id }}} + + + object_static_etc_sysctls_{{{ rule_id }}} +{{% if product not in [ "ol7", "ol8", "ol9", "rhcos4", "rhel7", "rhel8", "rhel9"] %}} + object_static_lib_sysctld_{{{ rule_id }}} +{{% endif %}} + + + object_static_sysctl_{{{ rule_id }}} @@ -193,7 +201,6 @@ object_static_run_sysctld_{{{ rule_id }}} - /etc/sysctl.conf {{{ sysctl_match() }}} @@ -222,7 +229,13 @@ ^.*\.conf$ {{{ sysctl_match() }}} - +{{% if product not in [ "ol7", "ol8", "ol9", "rhcos4", "rhel7", "rhel8", "rhel9"] %}} + + /lib/sysctl.d + ^.*\.conf$ + {{{ sysctl_match() }}} + +{{% endif %}} {{% if SYSCTLVAL is string %}} {{% if SYSCTLVAL == "" %}}