Fix suggestions

Signed-off-by: Radovan Sroka <rsroka@redhat.com>
This commit is contained in:
Radovan Sroka
2025-01-07 13:06:03 +01:00
committed by Sergei Petrosian
parent 24f5af0f92
commit e9ddf8804c
5 changed files with 41 additions and 11 deletions
+31 -5
View File
@@ -2,7 +2,7 @@
---
- name: Ensure that the cron is set up
hosts: all
gather_facts: false # test that role works in this case
gather_facts: false
roles:
- role: linux-system-roles.aide
vars:
@@ -10,12 +10,38 @@
aide_cron_check: true
aide_cron_interval: "0 12 * * *"
tasks:
- name: Print crontab 1
ansible.builtin.shell: cat /etc/crontab
- name: Check file content
ansible.builtin.lineinfile:
path: /etc/crontab
regexp: "^0 12 \\* \\* \\* root /usr/bin/aide --check"
state: absent
check_mode: true
changed_when: false
regexp: "^.* root /usr/sbin/aide --check"
line: "0 12 * * * root /usr/sbin/aide --check"
state: present
register: result
failed_when: result.changed
vars:
__fingerprint: system_role:aide
- name: Ensure that the cron is not set up
hosts: all
gather_facts: false
roles:
- role: linux-system-roles.aide
vars:
aide_cron_check: false
tasks:
- name: Print crontab 2
ansible.builtin.shell: cat /etc/crontab
- name: Check file content
ansible.builtin.lineinfile:
path: /etc/crontab
regexp: "^.* root /usr/sbin/aide --check"
line: "0 12 * * * root /usr/sbin/aide --check"
state: present
register: result
failed_when: not result.changed
vars:
__fingerprint: system_role:aide