bash-3.2$ ansible WS000 -m command -a "echo dork" -u jmarcus -f 1 -K
sudo password:
ws002.test.com | FAILED => ssh connection closed waiting for password prompt
Is this configurable?
Thanks,
James
bash-3.2$ ansible WS000 -m command -a "echo dork" -u jmarcus -f 1 -K
sudo password:
ws002.test.com | FAILED => ssh connection closed waiting for password prompt
Is this configurable?
Thanks,
James
while the timeout is configurable (see --help) this is more of a sign you got the password wrong or the password prompt was unexpectedly strange. More likely the former.
Could it be that sftp is disabled?
James
nah, it hasn’t tried to SFTP yet.
what version of ansible are you using? (ansible --version)?
Older versions of sudo didn’t support “–” and new versions omit it.
(Also what OS/version is your remote host?)
also: you should be able to use “-v -v -v” to see what commands are being executed to try them manually and learn a bit more.
bash-3.2$ ansible --version
ansible 0.7
Local OS is OSX 10.7
Remove OS is CentOS 5.8
Is this helpful?
bash-3.2$ ansible WS000 -m command -a "echo dork" -u jmarcus -f 1 -K -T 10 -vvvv
sudo password:
<ws002.test.com> ESTABLISH CONNECTION FOR USER: jmarcus
<ws002.test.com> EXEC "$SHELL" -c 'mkdir -p
$HOME/.ansible/tmp/ansible-1345145182.42-97158060563974 && chmod a+rx
$HOME/.ansible/tmp/ansible-1345145182.42-97158060563974 && echo
$HOME/.ansible/tmp/ansible-1345145182.42-97158060563974'
<ws002.test.com> REMOTE_MODULE command echo dork
<ws002.test.com> PUT
/var/folders/_s/lmr53wfd0xz81v8_0x317x4h0000gn/T/tmpedKYi0 TO
/home/jmarcus/.ansible/tmp/ansible-1345145182.42-97158060563974/command
<ws002.test.com> EXEC "$SHELL" -c 'chmod u+x
/home/jmarcus/.ansible/tmp/ansible-1345145182.42-97158060563974/command'
<ws002.test.com> EXEC sudo -k && sudo -p "[sudo via ansible,
key=enldcknfdpvkqgtatcedmjefiegvoevge] password: " -u root "$SHELL" -c
/home/jmarcus/.ansible/tmp/ansible-1345145182.42-97158060563974/command
Thanks,
James
I'm not going to be able to debug it for you, but you should be able
to learn more from this last part:
<ws002.test.com> EXEC sudo -k && sudo -p "[sudo via ansible,
key=enldcknfdpvkqgtatcedmjefiegvoevge] password: " -u root "$SHELL" -c
/home/jmarcus/.ansible/tmp/ansible-1345145182.42-97158060563974/command
You probably just want to try executing that directly with
/usr/bin/ssh and seeing what you get.
I encountered the same problem, and the issue was the /etc/sudoers did NOT require a password but I was passing the password via --sudo --ask-sudo-pass.
It appears that (at least on Scientific Linux 6.3 and sudo-1.7.4p5-12.el6_3.x86_64 on both machines), the password options must be in sync between Ansible and /etc/sudoers.
That is, if you use the Ansible options --sudo and --ask-sudo-pass, the host sudoers file MUST require that user to use a password. Conversly, if you use Ansible without the sudo password option, the host sudoers file MUST NOT require that user to use a password.
I've hit this issue before also, I just fixed my sudoers to be consistent.
I know this is old, but for the sake of documentation, I had this problem and it turned out
to be a bad line in the sudoers file (which I was editing), so after the first run the error appeared.