reorganize handlers

This commit is contained in:
2025-10-01 16:46:15 +02:00
parent 871457000b
commit 0cf277be68
2 changed files with 20 additions and 29 deletions

View File

@@ -1,9 +1,20 @@
- name: restart_nginx ---
service: - name: Update_aide_database
name: "nginx" tags: aide,hardening,system
state: restarted block:
- name: system setup | aide | run aide --update to check for legitimate changes
command: aide --update
register: aide_update_result
changed_when: "'new database written to' in aide_update_result.stdout"
async: 1800 # Allow up to 30 minutes for update
poll: 15
- name: restart_snmpd - name: system setup | aide | activate updated database
service: copy:
name: "snmpd" src: /var/lib/aide/aide.db.new
state: restarted dest: /var/lib/aide/aide.db
remote_src: true
owner: root
group: root
mode: '0600'
when: aide_update_result.changed

View File

@@ -1,24 +1,4 @@
--- ---
- name: reload ufw - name: reload ufw
command: ufw reload command: ufw reload
listen: "reload ufw firewall" listen: "reload ufw firewall"
- name: Update_aide_database
tags: aide,hardening,system
block:
- name: system setup | aide | run aide --update to check for legitimate changes
command: aide --update
register: aide_update_result
changed_when: "'new database written to' in aide_update_result.stdout"
async: 1800 # Allow up to 30 minutes for update
poll: 15
- name: system setup | aide | activate updated database
copy:
src: /var/lib/aide/aide.db.new
dest: /var/lib/aide/aide.db
remote_src: true
owner: root
group: root
mode: '0600'
when: aide_update_result.changed