Hi,
I'm trying to use the become module to execute some commands as root, but
i'm having some troubles because of the restrictions i have on remote
server.
It seems the become module executes sudo with a shell to execute the
commands:
/bin/sh -c '"'"'sudo -H -S -p "[sudo via ansible,
key=eegsvbeikrvdaoiocjgbkmmujauvqnaf] password: " -u root */bin/sh -c*
'"'"'"'"'"'"'"'"'echo BECOME-SUCCESS-eegsvbeikrvdaoiocjgbkmmujauvqnaf; ...
the problem is that my user doesn't have permissions to execute /bin/sh
with sudo: "Sorry, user xxxxxx is not allowed to execute '/bin/sh -c echo
BECOME..."
Is there anyway to not run the shell? just run sudo -u root "command" ?
I've tried to change the executable variable to "executable =" on
ansible.cfg but then i get this error:
fatal: [XXXXXXXXX]: FAILED! => {"changed": false, "failed": true,
"invocation": {"module_name": "command"}, "module_stderr": "",
"module_stdout": "usage: sudo -h | -K | -k | -L | -l | -V | -v\r\nusage:
sudo [-bEHkPS] [-p prompt] [-u username|#uid] [VAR=value]\r\n
{-i | -s | <command>}\r\nusage: sudo -e [-kS] [-p prompt] [-u
username|#uid] file ...\r\n", "msg": "MODULE FAILURE"}
--
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/3ff9be00-7666-44e8-b1a0-cf0aba093877%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.