- name: Gather the package facts
package_facts:
manager: auto
tags:
- NIST-800-171-3.1.20
- NIST-800-53-CM-6(a) - NIST-800-53-CM-7(a)
- NIST-800-53-CM-7(b)
- disable_strategy
- low_complexity
- medium_disruption
- medium_severity
- reboot_required
- sysctl_net_ipv6_conf_all_disable_ipv6
- name: List /etc/sysctl.d/*.conf files
find:
paths:
- /etc/sysctl.d/
- /run/sysctl.d/
- /usr/local/lib/sysctl.d/
- /usr/lib/sysctl.d/
contains: ^[\s]*net.ipv6.conf.all.disable_ipv6.*$
patterns: '*.conf'
file_type: any
register: find_sysctl_d
when: '"kernel" in ansible_facts.packages'
tags:
- NIST-800-171-3.1.20
- NIST-800-53-CM-6(a)
- NIST-800-53-CM-7(a)
- NIST-800-53-CM-7(b)
- disable_strategy
- low_complexity
- medium_disruption
- medium_severity
- reboot_required
- sysctl_net_ipv6_conf_all_disable_ipv6
- name: Comment out any occurrences of net.ipv6.conf.all.disable_ipv6 from config
files
replace:
path: '{{ item.path }}'
regexp: ^[\s]*net.ipv6.conf.all.disable_ipv6
replace: '#net.ipv6.conf.all.disable_ipv6'
loop: '{{ find_sysctl_d.files }}'
when: '"kernel" in ansible_facts.packages'
tags:
- NIST-800-171-3.1.20
- NIST-800-53-CM-6(a)
- NIST-800-53-CM-7(a)
- NIST-800-53-CM-7(b)
- disable_strategy
- low_complexity
- medium_disruption
- medium_severity
- reboot_required
- sysctl_net_ipv6_conf_all_disable_ipv6
- name: Ensure sysctl net.ipv6.conf.all.disable_ipv6 is set to 1
sysctl:
name: net.ipv6.conf.all.disable_ipv6
value: '1'
sysctl_file: /etc/sysctl.conf
state: present
reload: true
when: '"kernel" in ansible_facts.packages'
tags:
- NIST-800-171-3.1.20
- NIST-800-53-CM-6(a)
- NIST-800-53-CM-7(a)
- NIST-800-53-CM-7(b)
- disable_strategy
- low_complexity
- medium_disruption
- medium_severity
- reboot_required
- sysctl_net_ipv6_conf_all_disable_ipv6
Show more