feat: Allow setup aide inside of cron job

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 cdfdd3523d
commit 49e267a29b
5 changed files with 77 additions and 0 deletions
+14
View File
@@ -104,3 +104,17 @@
ansible.builtin.file:
path: "{{ __aide_db_new_name }}"
state: absent
- name: Update aide check cron configuration if necessary
ansible.builtin.lineinfile:
path: /etc/crontab
regexp: "^.* root /usr/sbin/aide --check"
line: "{{ aide_cron_interval }} root /usr/sbin/aide --check"
when: aide_cron_check | bool
- name: Remove aide check cron configuration if necessary
ansible.builtin.lineinfile:
path: /etc/crontab
state: absent
regexp: "^.* root /usr/sbin/aide --check"
when: not aide_cron_check | bool