Just some further info.

I updated to Ansible 2.3.0 but the problem still persists.

Just to test things, I wrote a bit of a 'dirty' handler like this:

<- Cut ->
- name: reload_auditd_C7
  command: service "{{ audit_service }}" restart
<- Cut ->

This works, although it throws a warning: "[WARNING]: Consider using 
service module rather than running service"

To me it starts to feel like there might be some kind of bug when it comes 
to this? 

Cheers, Mike

On Wednesday, April 12, 2017 at 10:27:44 PM UTC+1, Swedish Mike wrote:
>
> Hi All,
>
> I'm currently trying to build a role to maintain auditd across our 
> machines. We got a couple of different flavours of Linux  as well as 
> versions thereof running in our environment  so I'm trying to get it to 
> work across all of them.
>
> This is mainly working well, unless I count Centos 7.
>
> When the config and/or rules files have been updated I'm calling a handler 
> named 'reload_auditd' which looks as follows:
>
>
> - name: reload_auditd
>   service:
>     name: auditd
>     state: restarted
>
> This works fine on Centos6 and Ubuntu but Centos 7 fires the following 
> error message:
>
> <- Cut ->
> fatal: [nsm-rh-silk]: FAILED! => {"changed": false, "failed": true, "msg": 
> "Unable to restart service auditd: Failed to restart auditd.service: 
> Operation refused, unit auditd.service may be requested by dependency 
> only.\nSee system logs and 'systemctl status auditd.service' for 
> details.\n"}
> <- Cut ->
>
> I had a look in the archive of this mailing list and could find one 
> previous question where the only reply ended with: "in short, use the 
> service command.". Since I am using the service command I'm a little bit 
> stuck here - does anyone have any further info/help to provide?
>
> Thanks in advance, Mike
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/57f241b2-f1b5-4e66-802f-ebd56a581d4a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to