4
0
Fork 0

tidy up sysctl templates

Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
This commit is contained in:
Mark Bolwell 2022-04-04 15:14:13 +01:00
parent 8b8aef291b
commit fef891dc1b
No known key found for this signature in database
GPG key ID: F734FDFC154B83FB
5 changed files with 66 additions and 67 deletions

View file

@ -3,22 +3,18 @@
- name: "3.2.1 | PATCH | Ensure IP forwarding is disabled"
block:
- name: "3.2.1 | PATCH | Ensure IP forwarding is disabled | Disable IPv4 forwarding"
sysctl:
name: net.ipv4.ip_forward
value: '0'
state: present
reload: yes
ignoreerrors: yes
notify: sysctl flush ipv4 route table
debug:
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-netipv4_sysctl.conf"
notify:
- update sysctl
- sysctl flush ipv4 route table
- name: "3.2.1 | PATCH | Ensure IP forwarding is disabled | Disable IPv6 forwarding"
sysctl:
name: net.ipv6.conf.all.forwarding
value: '0'
state: present
reload: yes
ignoreerrors: yes
notify: sysctl flush ipv6 route table
debug:
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-netipv6_sysctl.conf"
notify:
- update sysctl
- sysctl flush ipv6 route table
when: rhel9cis_ipv6_required
when:
- not rhel9cis_is_router
@ -32,17 +28,11 @@
- rule_3.2.1
- name: "3.2.2 | PATCH | Ensure packet redirect sending is disabled"
sysctl:
name: '{{ item.name }}'
value: '{{ item.value }}'
sysctl_set: yes
state: present
reload: yes
ignoreerrors: yes
notify: sysctl flush ipv4 route table
with_items:
- { name: net.ipv4.conf.all.send_redirects, value: 0 }
- { name: net.ipv4.conf.default.send_redirects, value: 0 }
debug:
msg: "Control being set via Handler 'update sysctl' which writes to /etc/sysctl.d/60-netipv4_sysctl.conf"
notify:
- update sysctl
- sysctl flush ipv4 route table
when:
- not rhel9cis_is_router
- rhel9cis_rule_3_2_2