Skip to content

Commit

Permalink
add separate handlers for audit restart
Browse files Browse the repository at this point in the history
Signed-off-by: Martin Schurz <[email protected]>
  • Loading branch information
schurzi committed Nov 21, 2023
1 parent 84c43c0 commit 60d1081
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion roles/os_hardening/handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
- name: Update-initramfs # noqa no-changed-when
ansible.builtin.command: update-initramfs -u

- name: Restart auditd
ansible.builtin.systemd:
name: auditd
state: restarted
when:

Check failure on line 9 in roles/os_hardening/handlers/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces
- molecule_yml.driver.name | default() != "docker" # restarting auditd in a container does not

Check failure on line 10 in roles/os_hardening/handlers/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces
- not ansible_facts.os_family == 'RedHat'

- name: Restart auditd # noqa command-instead-of-module no-changed-when
ansible.builtin.command:
cmd: service auditd restart # rhel: see: https://access.redhat.com/solutions/2664811
when: molecule_yml.driver.name | default() != "docker" # restarting auditd in a container does not work
when:

Check failure on line 16 in roles/os_hardening/handlers/main.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[trailing-spaces]

Trailing spaces
- molecule_yml.driver.name | default() != "docker" # restarting auditd in a container does not work
- ansible_facts.os_family == 'RedHat'

- name: Reload systemd
ansible.builtin.systemd:
Expand Down

0 comments on commit 60d1081

Please sign in to comment.