Skip to content

Commit

Permalink
Fix whens on one line
Browse files Browse the repository at this point in the history
Signed-off-by: Radovan Sroka <[email protected]>
  • Loading branch information
radosroka committed Nov 11, 2024
1 parent 028a291 commit 16771de
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ This is an ansible role that installs and configures the [Advanced Intrusion Det
* It runs AIDE integrity checks on the remote nodes
* It updates the AIDE databases and stores them on the controller node

### Available tags to control and use the role

## What does this role not do for you?

* It does not explain how to create a good AIDE configuration that suits your requirements; that task remains for you to accomplish
Expand Down
26 changes: 8 additions & 18 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@
src: "{{ aide_db_template }}"
dest: "/etc/{{ __aide_config }}"
mode: "0400"
when:
- aide_db_template is defined
- aide_db_template is not none
- aide_db_template is string
when: aide_db_template is not none

# - name: Print Header
# ansible.builtin.shell: head /etc/aide.conf || true

- name: Initialize AIDE database
when:
- aide_init | bool
when: aide_init | bool
block:
- name: Initialize AIDE database
ansible.builtin.command:
Expand All @@ -49,19 +45,16 @@
group: root
mode: "0440"
force: true
when:
- not aide_fetch_db | bool
when: not aide_fetch_db | bool

- name: Remove remote AIDE database file
ansible.builtin.file:
path: "{{ __aide_db_new_name }}"
state: absent
when:
- not aide_fetch_db | bool
when: not aide_fetch_db | bool

- name: Fetch AIDE database
when:
- aide_fetch_db | bool
when: aide_fetch_db | bool
block:
- name: Fetch AIDE database
ansible.builtin.fetch:
Expand All @@ -74,8 +67,7 @@
state: absent

- name: Check AIDE integrity
when:
- aide_check | bool
when: aide_check | bool
block:
- name: Copy AIDE reference database
ansible.builtin.copy:
Expand All @@ -85,17 +77,15 @@
owner: root
group: root
mode: "0440"
when:
- aide_fetch_db | bool
when: aide_fetch_db | bool

- name: Check against AIDE reference database
ansible.builtin.command:
cmd: aide --check
changed_when: true

- name: Update AIDE database and fetch it
when:
- aide_update | bool
when: aide_update | bool
block:
- name: Update AIDE database
ansible.builtin.command:
Expand Down

0 comments on commit 16771de

Please sign in to comment.