Hi @ all,

i try to start/stop a service with ansible adn need to execute the comand 
with sudo:

executing 
"sudo /usr/bin/systemctl start filebeat.service" 

works pretty fine, but i would like to use the service-modul.

My playbook looks like this:


-
        name: testplay
        hosts: hostname

        tasks:
         - name: stop filebeat
           become: true
           become_method: sudo
           become_user: root
           service:
             name: filebeat.service
             state: stopped



i get this error:

ASK [stop filebeat] 
************************************************************************************************************************************************************************************************************************
fatal: [vlq23007]: FAILED! => {"changed": false, "module_stderr": "Shared 
connection to hostname closed.\r\n", "module_stdout": "Sorry, user sudouser 
is not allowed to execute '/bin/sh -c echo 
BECOME-SUCCESS-sodoffndzuoxshzljbtmzwmyfysryhkf; /usr/bin/python 
/home/sudouser/.ansible/tmp/ansible-tmp-1568288715.75-4453183611448/systemd.py; 
rm -rf 
\"/home/sudouser/.ansible/tmp/ansible-tmp-1568288715.75-4453183611448/\" > 
/dev/null 2>&1' as root on hostname.\r\n", "msg": "MODULE FAILURE", "rc": 1}



Are there any ideas how to fix it?

greetz

Torsten

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2ca4e26c-8d54-4a30-a09b-77c70d88b78d%40googlegroups.com.

Reply via email to