-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathharden_aide.yml
32 lines (28 loc) · 901 Bytes
/
harden_aide.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
---
- name: OpenVPN | AIDE | Check for DB
stat:
path: "{{ path_aide_db }}"
register: aide_db_check
- name: OpenVPN | AIDE | Initialize AIDE DB
shell: aideinit
changed_when: false
when: ansible_os_family == "Debian" and aide_db_check.stat.exists == false
tags:
- skip_ansible_lint
- name: OpenVPN | AIDE | Initialize AIDE DB
shell: aide --init
changed_when: false
when: ansible_os_family == "RedHat" and aide_db_check.stat.exists == false
tags:
- skip_ansible_lint
- name: OpenVPN | AIDE | Copy initialized DB
copy:
remote_src: true
src: /var/lib/aide/aide.db.new.gz
dest: "{{ path_aide_db }}"
when: ansible_os_family == "RedHat" and aide_db_check.stat.exists == false
- name: OpenVPN | AIDE | Delete old DB
file:
path: /var/lib/aide/aide.db.new.gz
state: absent
when: ansible_os_family == "RedHat" and aide_db_check.stat.exists == false