Skip to content

Commit fa365a3

Browse files
authored
Merge pull request #173 from Jason-Hendry/fix/ipv6disable-grub-mutliple-entries
fix: #172 checks if ipv6.disable is present in GRUB_CMDLINE_LINUX bef…
2 parents fba3678 + 4e67550 commit fa365a3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

tasks/section_3/cis_3.1.x.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,23 @@
1111
register: ipv6disable_replaced
1212
notify: Grub update
1313

14+
- name: "3.1.1 | PATCH | Ensure system is checked to determine if IPv6 is enabled | Check grub cmdline linux"
15+
ansible.builtin.shell: grep "GRUB_CMDLINE_LINUX=" /etc/default/grub | cut -f2 -d'"'
16+
changed_when: false
17+
failed_when: false
18+
check_mode: false
19+
register: ubtu22cis_3_1_1_cmdline_settings
20+
when: ubtu22cis_ipv6_disable == 'grub'
21+
1422
- name: "3.1.1 | PATCH | Ensure system is checked to determine if IPv6 is enabled | Insert ipv6.disable if it doesn't exist"
1523
ansible.builtin.lineinfile:
1624
path: /etc/default/grub
1725
regexp: '^(GRUB_CMDLINE_LINUX=".*)"$'
1826
line: '\1 ipv6.disable=1"'
1927
backrefs: true
20-
when: ipv6disable_replaced is not changed
28+
when:
29+
- ipv6disable_replaced is not changed
30+
- "'ipv6.disable' not in ubtu22cis_3_1_1_cmdline_settings.stdout"
2131
notify: Grub update
2232

2333
- name: "3.1.1 | PATCH | Ensure system is checked to determine if IPv6 is enabled | Remove net.ipv6.conf.all.disable_ipv6"

0 commit comments

Comments
 (0)