Skip to content

Commit e3d3720

Browse files
Add SLE16 support for sysctl related templates
1 parent ba8f301 commit e3d3720

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

shared/templates/sysctl/ansible.template

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
- name: {{{ rule_title }}} - Set fact for sysctl paths
1212
ansible.builtin.set_fact:
13-
{{% if product in ["sle12", "sle15", "slmicro5", "slmicro6"] %}}
13+
{{% if product in ["sle12", "sle15", "sle16", "slmicro5", "slmicro6"] %}}
1414
sysctl_paths:
1515
- "/run/sysctl.d/"
1616
- "/etc/sysctl.d/"
@@ -22,7 +22,7 @@
2222
- "/run/sysctl.d/"
2323
- "/usr/local/lib/sysctl.d/"
2424
{{% endif %}}
25-
{{% if product not in ["fedora", "ol7", "ol8", "ol9", "rhcos4", "rhel8", "rhel9", "rhel10", "sle12", "sle15", "slmicro5", "slmicro6", "ubuntu2204", "ubuntu2404"] %}}
25+
{{% if product not in ["fedora", "ol7", "ol8", "ol9", "rhcos4", "rhel8", "rhel9", "rhel10", "sle12", "sle15", "sle16", "slmicro5", "slmicro6", "ubuntu2204", "ubuntu2404"] %}}
2626
- "/usr/lib/sysctl.d/"
2727
{{% endif %}}
2828

@@ -65,9 +65,11 @@
6565
{{% if sysctl_remediate_drop_in_file == "true" %}}
6666
- name: {{{ rule_title }}} - Comment out any occurrences of {{{ SYSCTLVAR }}} from /etc/sysctl.conf
6767
ansible.builtin.replace:
68-
path: "/etc/sysctl.conf"
68+
path: "{{ item }}"
6969
regexp: '^[\s]*{{{ SYSCTLVAR }}}'
7070
replace: '#{{{ SYSCTLVAR }}}'
71+
with_fileglob:
72+
- "/etc/sysctl.conf"
7173
{{% endif %}}
7274

7375
{{%- if SYSCTLVAL == "" or SYSCTLVAL is not string %}}
@@ -88,4 +90,3 @@
8890
{{% endif %}}
8991
state: present
9092
reload: yes
91-

0 commit comments

Comments
 (0)