Hi
I’ve just started experimenting with Ansible to see if it’s possible to configure a number of Jenkins slaves. My first experiment to ping machineB from machineA was successful:
eanwwie@machineA:/home/eanwwie$ ansible -m ping machineB -k -vvv -k
SSH password:
ESTABLISH CONNECTION FOR USER: eanwwie on PORT 22 TO machineB
EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1374149419.03-33975991660692 && chmod a+rx $HOME/.ansible/tmp/ansible-1374149419.03-33975991660692 && echo $HOME/.ansible/tmp/ansible-1374149419.03-33975991660692’
REMOTE_MODULE ping
PUT /tmp/tmpnqCAAX TO /home/eanwwie/.ansible/tmp/ansible-1374149419.03-33975991660692/ping
EXEC /bin/sh -c ‘/usr/bin/python /home/eanwwie/.ansible/tmp/ansible-1374149419.03-33975991660692/ping; rm -rf /home/eanwwie/.ansible/tmp/ansible-1374149419.03-33975991660692/ >/dev/null 2>&1’
machineB | success >> {
“changed”: false,
“ping”: “pong”
}
But when I try to do this in sudo mode I get the error below:
eanwwie@machineA:/home/eanwwie$ ansible -m ping machineB -k -vvv -k --sudo -K
SSH password:
sudo password [defaults to SSH password]:
ESTABLISH CONNECTION FOR USER: eanwwie on PORT 22 TO machineB
EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1374149543.45-250513362696036 && chmod a+rx $HOME/.ansible/tmp/ansible-1374149543.45-250513362696036 && echo $HOME/.ansible/tmp/ansible-1374149543.45-250513362696036’
REMOTE_MODULE ping
PUT /tmp/tmpWP3ATz TO /home/eanwwie/.ansible/tmp/ansible-1374149543.45-250513362696036/ping
EXEC /bin/sh -c “sudo -k && sudo -H -S -p "[sudo via ansible, key=efqghgpcbafoylkvjmxtjaeicklbdlgd] password: " -u root /bin/sh -c ‘/usr/bin/python /home/eanwwie/.ansible/tmp/ansible-1374149543.45-250513362696036/ping; rm -rf /home/eanwwie/.ansible/tmp/ansible-1374149543.45-250513362696036/ >/dev/null 2>&1’”
machineB | FAILED => ssh connection closed waiting for password prompt
I suspect this is because the password prompt is the non-standard “Enter Windows password:”. Can anyone confirm this is true? If so, what can I do about it?
ansible version 1.2.2
machineA: Ubuntu 10.04 LTS
machineB: Ubuntu 12.04 LTS
Thanks,
Andy