Windows 10
babun version 1.2.0
Vagrant 1.7.4
ansible 1.9.3
First run
{ Centos } » ansible testserver -s -m yum -a name=nano -vvvv
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant
<127.0.0.1> REMOTE_MODULE yum name=nano
<127.0.0.1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/home/micha/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o Port=2222 -o IdentityFile=“./.vagrant/machines/default/virtualbox/private_key” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 127.0.0.1 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1442576330.79-80907768843041 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1442576330.79-80907768843041 && echo $HOME/.ansible/tmp/ansible-tmp-1442576330.79-80907768843041’
testserver | FAILED => SSH Error: Failed to connect to new control master
while connecting to 127.0.0.1:2222
It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
Right after
{ Centos } » ansible testserver -s -m yum -a name=nano -vvvv
<127.0.0.1> ESTABLISH CONNECTION FOR USER: vagrant
<127.0.0.1> REMOTE_MODULE yum name=nano
<127.0.0.1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/home/micha/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o Port=2222 -o IdentityFile=“./.vagrant/machines/default/virtualbox/private_key” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 127.0.0.1 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1442576335.72-42863877661228 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1442576335.72-42863877661228 && echo $HOME/.ansible/tmp/ansible-tmp-1442576335.72-42863877661228’
<127.0.0.1> PUT /tmp/tmpAV8UAI TO /home/vagrant/.ansible/tmp/ansible-tmp-1442576335.72-42863877661228/yum
<127.0.0.1> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/home/micha/.ansible/cp/ansible-ssh-%h-%p-%r” -o StrictHostKeyChecking=no -o Port=2222 -o IdentityFile=“./.vagrant/machines/default/virtualbox/private_key” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=vagrant -o ConnectTimeout=10 127.0.0.1 /bin/sh -c ‘sudo -k && sudo -H -S -p “[sudo via ansible, key=dfklobmmhxvkowckqjztyjdzczexhhrs] password: " -u root /bin/sh -c '”’“‘echo BECOME-SUCCESS-dfklobmmhxvkowckqjztyjdzczexhhrs; LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python -tt /home/vagrant/.ansible/tmp/ansible-tmp-1442576335.72-42863877661228/yum; rm -rf /home/vagrant/.ansible/tmp/ansible-tmp-1442576335.72-42863877661228/ >/dev/null 2>&1’”‘"’’
testserver | success >> {
“changed”: false,
“msg”: “”,
“rc”: 0,
“results”: [
“nano-2.0.9-7.el6.x86_64 providing nano is already installed”
]
}