2022-03-30 11:02:30 +01:00
---
- name : "1.1.3.1 | AUDIT | Ensure separate partition exists for /var"
block :
- name : "1.1.3.1 | AUDIT | Ensure separate partition exists for /var | Absent"
2023-01-09 16:29:47 +00:00
ansible.builtin.debug :
2022-07-20 17:13:33 +01:00
msg : "Warning!! {{ required_mount }} doesn't exist. This is a manual task"
2022-03-30 11:02:30 +01:00
2023-01-19 10:07:14 +00:00
- name : "1.1.3.1 | AUDIT | Ensure separate partition exists for /var | Present"
2023-09-21 15:07:52 +01:00
ansible.builtin.import_tasks :
2023-09-21 15:35:35 +01:00
file : warning_facts.yml
2022-03-30 11:02:30 +01:00
vars :
2023-01-13 11:05:25 +00:00
warn_control_id : '1.1.3.1'
2022-03-30 11:02:30 +01:00
required_mount : '/var'
when :
2023-01-13 11:05:25 +00:00
- required_mount not in mount_names
2022-03-30 11:22:30 +01:00
- rhel9cis_rule_1_1_3_1
2022-03-30 11:02:30 +01:00
tags :
- level2-server
- level2-workstation
- patch
- mounts
- rule_1.1.3.1
# skips if mount is absent
- name : |
"1.1.3.2 | PATCH | Ensure nodev option set on /var partition"
2023-01-09 16:29:47 +00:00
"1.1.3.3 | PATCH | Ensure nosuid option set on /var partition"
ansible.builtin.mount :
2022-03-30 11:02:30 +01:00
name : /var
src : "{{ item.device }}"
fstype : "{{ item.fstype }}"
state : present
2024-11-11 15:59:07 +00:00
opts : "{{ item.options }}{% if ('nodev' not in item.options and rhel9cis_rule_1_1_3_2) %},nodev{% endif %}{% if ('nosuid' not in item.options and rhel9cis_rule_1_1_3_3) %},nosuid{% endif %}"
loop : "{{ ansible_facts.mounts }}"
loop_control :
2022-03-30 11:02:30 +01:00
label : "{{ item.device }}"
2023-01-13 12:10:18 +00:00
notify : Change_requires_reboot
2022-03-30 11:02:30 +01:00
when :
- item.mount == "/var"
2022-03-30 11:22:30 +01:00
- rhel9cis_rule_1_1_3_2 or
2023-01-23 13:58:50 +00:00
rhel9cis_rule_1_1_3_3
2022-03-30 11:02:30 +01:00
tags :
- level1-server
- level1-workstation
- patch
- mounts
- skip_ansible_lint
- rule_1.1.3.2
- rule_1.1.3.3