RHEL9-CIS/tasks/section_4/cis_4.3.yml
Mark Bolwell c6caa90059
updated
Signed-off-by: Mark Bolwell <mark.bollyuk@gmail.com>
2022-03-30 16:18:11 +01:00

28 lines
781 B
YAML

---
- name: "4.3 | PATCH | Ensure logrotate is configured"
block:
- name: "4.3 | AUDIT | Ensure logrotate is configured | Get logrotate settings"
find:
paths: /etc/logrotate.d/
register: log_rotates
- name: "4.3 | PATCH | Ensure logrotate is configured"
replace:
path: "{{ item.path }}"
regexp: '^(\s*)(daily|weekly|monthly|yearly)$'
replace: "\\1{{ rhel9cis_logrotate }}"
with_items:
- "{{ log_rotates.files }}"
- { path: "/etc/logrotate.conf" }
loop_control:
label: "{{ item.path }}"
when:
- rhel9cis_rule_4_3
tags:
- level1-server
- level1-workstation
- manual
- patch
- logrotate
- rule_4.3