How to manage auditd using ansible ?
Issue
- How to reload/restart/stop
auditd
usingansible
? - Reloading
auditd.service
usingservice
module ofansible
fails with following error :
$ cat test.yml
---
- name: Testing Service Module
hosts: test
tasks:
- name: Reload Auditd
service:
name: auditd
state: reloaded
$ ansible-playbook test.yml
<snip>
TASK [Reload Auditd] ***********************************************************************************
fatal: [10.10.96.13]: FAILED! => {"changed": false, "msg": "Unable to reload service auditd: Failed to reload auditd.service: Job type reload is not applicable for unit auditd.service.\nSee system logs and 'systemctl status auditd.service' for details.\n"}
<snip>
Environment
- Red Hat Enterprise Linux 7
- Red Hat Enterprise Linux 8
- ansible
- auditd
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.