Skip to content

Commit d05b4cf

Browse files
Merge pull request #14329 from teacup-on-rockingchair/sle16_fix_sysctl_related_ansible_remediations
SLE16 fix sysctl related ansible remediations
2 parents 260e387 + 0d09716 commit d05b4cf

File tree

3 files changed

+8
-7
lines changed
  • linux_os/guide/system
    • permissions/restrictions/enable_execshield_settings/sysctl_kernel_exec_shield/ansible
    • software/updating/ensure_gpgcheck_never_disabled/ansible
  • shared/templates/sysctl

3 files changed

+8
-7
lines changed

linux_os/guide/system/permissions/restrictions/enable_execshield_settings/sysctl_kernel_exec_shield/ansible/shared.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
reload: yes
3333
when: kexec_arch == "b32"
3434

35-
{{% if 'ubuntu' in product or product in ['ol7', 'sle12', 'sle15'] %}}
35+
{{% if 'ubuntu' in product or product in ['ol7', 'sle12', 'sle15', 'sle16'] %}}
3636
- name: Check noexec argument exists
3737
ansible.builtin.command: grep '^GRUB_CMDLINE_LINUX=.*noexec=.*"' /etc/default/grub
3838
failed_when: False
@@ -51,7 +51,7 @@
5151

5252
{{% endif -%}}
5353

54-
{{% if product in ['sle12', 'sle15'] %}}
54+
{{% if product in ['sle12', 'sle15', 'sle16'] %}}
5555
- name: Update grub defaults and the bootloader menu
5656
ansible.builtin.command: /usr/sbin/grub2-mkconfig -o {{{ grub2_boot_path }}}/grub.cfg
5757
when: kexec_arch == "b64"

linux_os/guide/system/software/updating/ensure_gpgcheck_never_disabled/ansible/shared.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- name: Grep for {{{ pkg_manager }}} repo section names
77
ansible.builtin.shell: |
88
set -o pipefail
9-
{{%- if product in ["sle12", "sle15", "slmicro5"] %}}
9+
{{%- if 'sle' in product or 'slmicro' in product %}}
1010
grep -HEr '^\[.+\]' -r /etc/zypp/repos.d/
1111
{{%- else %}}
1212
grep -HEr '^\[.+\]' -r /etc/yum.repos.d/

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 'sle' in product or 'slmicro' in product %}}
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)