Hi,

On 28.03.19 14:49, R-JRI wrote:
> TASK [Gathering Facts] 
> **********************************************************************************************************************************************************************************************************************
> fatal: [host1]: FAILED! => {"changed": false, "module_stderr": "Shared 
> connection to host1 closed.\r\n", "module_stdout": "Sorry, user appsadmin 
> is not allowed to execute '/bin/sh -c echo 
> BECOME-SUCCESS-fxdiujleiigrbgciqkixarzuxhsbngrr; /usr/bin/python 
> /u/appadmin/.ansible/tmp/ansible-tmp-1553780641.69-82349845573466/AnsiballZ_setup.py'
>  
> as root on host1.\r\n", "msg": "MODULE FAILURE\nSee stdout/stderr for the 
> exact error", "rc": 1}

If the user you use with ansible is only allowed to execute this script
with sudo and not use sudo for ALL, then you are right to use

command: sudo /usr/local/bin/application_stop_start.sh stop

You may want to add

warn: no

See:
https://docs.ansible.com/ansible/latest/modules/command_module.html?highlight=warn

Sebastian

-- 
Sebastian Meyer
Linux Consultant & Trainer
Mail: me...@b1-systems.de

B1 Systems GmbH
Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/989902cd-8f69-d1fd-5ea6-3bc945903289%40b1-systems.de.
For more options, visit https://groups.google.com/d/optout.

Reply via email to