What happens when you use:
- name: "stop nginx"
  systemd:
      name: nginx
      state: stopped

==> It's the same problem, the message error is :

changed: [edeefreffe] => {"changed": true, "msg": "Service nginx not found 
on host, assuming it will exist on full run"}

Same in specify become or become_user

Le lundi 11 février 2019 10:48:06 UTC+1, Sudheer S a écrit :
>
>
> On 11/02/19 2:31 PM, [email protected] <javascript:> wrote:
>
> So,
>
> When I run my playbook with this task :
>
> - name: "stop nginx"
>   service:
>       name: nginx
>       state: stopped
>
> I have this message :
>
> changed: [edeefreffe] => {"changed": true, "msg": "Service nginx not found 
> on host, assuming it will exist on full run"}
>
> What happens when you use:
> - name: "stop nginx"
>   systemd:
>       name: nginx
>       state: stopped
>
> I see that you are using `systemctl` in the command module but using 
> `service` module in the task. Change it to systemd like above and tell us 
> what happens. 
> -
> Sudheer
>
>
> but with this command ansible it's work : 
>
> - name: "Arret du nginx"
>   command: sudo systemctl stop nginx
>
> Someone have a answer please ??!
>
> Thanks you very much !! :)
>
>
> Le vendredi 8 février 2019 17:16:59 UTC+1, [email protected] a écrit : 
>>
>> Hi, 
>>
>> When i use service in ansible same this task :
>>
>> - name: "stop nginx"
>>   service:
>>       name: nginx
>>       state: stopped
>>
>> Same with "become: yes" and "pattern: my_pattern_file"
>>
>> but with line "command: sudo systemctl stop nginx"   it's working !! WHY ?
>>
>> Thanks you for you answers guy ! :)
>>
> -- 
> 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] <javascript:>.
> To post to this group, send email to [email protected] 
> <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/ansible-project/35f9bd5f-5743-417f-b449-905e092828a0%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/ansible-project/35f9bd5f-5743-417f-b449-905e092828a0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
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/ca04e950-5550-428c-9386-f7f0e8941422%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to