My sudoers file specifies the paths of commands I may use, bash in not one of them. Thank you for your reply.
On Sunday, October 5, 2014 3:29:25 PM UTC-4, Strahinja Kustudić wrote: > To be able to use sudo with Ansible, you will need to allow the user > Ansible is login as full rights to execute all commands. > > I'm curious, how did you configure your sudoers files, since I don't see > you executing any commands, but using the file module. > > > > On Friday, October 3, 2014 7:30:06 PM UTC+2, Tiglath wrote: >> >> >> >> >> When trying this on Solaris 11 server. >> >> >> >> ansible <servername> --sudo -i hosts -m file -a "state=directory >> dest=/export/home/foo" >> >> sudo password: <pwd> >> >> I kept getting this error: >> >> <servername> | FAILED => ssh connection closed waiting for sudo or >> su password prompt >> >> I tried putting this on /etc/sudoers: >> >> Default;<username>: !requiretty >> >> Same error. But it disappear when I changed pipelinining to false in >> the ansible config file. >> >> However, the sudo permissions needed are to execute bash, not mkdir. >> >> "Sorry, user <username> is not allowed to execute '/bin/bash -c echo >> SUDO-SUCCESS-xmmcizgbypydurtfuarqtsrufpgbwgoe; LC_CTYPE=C LANG=C....' >> >> which is to ask a lot in my environment -- banking -- so it looks like >> for sudo operations I won't be able to use Ansible sudo, but I will have to >> do it inside scripts and use the script module. >> >> I suspect there is no way around this. Right? >> >> >> >> >> >> >> >> >> > -- 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/a9ad5f9d-7e35-464a-a3d1-132a61a90786%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
