Skip to content

Commit

Permalink
Updates handlers for new ansible syntax and deprecated options for le…
Browse files Browse the repository at this point in the history
…gacy commands (dev-sec#602)

* Update main.yml

fixes the handler file and set new syntax

Signed-off-by: Jacob Sievert <jacob.sievert@sievert-mail.de>

* changes command module from legacy to builtin.

Signed-off-by: Jacob Sievert <jacob.sievert@sievert-mail.de>

Signed-off-by: Jacob Sievert <jacob.sievert@sievert-mail.de>
  • Loading branch information
jsievertde authored and Sebastian Gumprich committed Nov 28, 2022
1 parent 53ca2cd commit 78eff8a
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions roles/os_hardening/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
---
- name: Update-initramfs
command: 'update-initramfs -u'
ansible.builtin.command: 'update-initramfs -u'

- name: Restart auditd
command:
ansible.builtin.command:
cmd: 'service auditd restart' # rhel: see: https://access.redhat.com/solutions/2664811
warn: false # sadly 'service' module fails in that case also by using 'use: service'
when: molecule_yml is not defined # restarting auditd in a container does not work

- name: Reload systemd
systemd:
ansible.builtin.systemd:
daemon_reload: true

- name: Remount filesystems
mount:
ansible.posix.mount:
path: "{{ item }}"
state: remounted
loop: "{{ mountpoints_changed }}"

0 comments on commit 78eff8a

Please sign in to comment.