I keep beating my head against the wall - a few days ago, ansible stopped being able to connect to one of my boxes. It just hangs after the output below. The only stuff I've done to the box recently is to do apt-get upgrade... Nothing else. Worked perfectly before. I'm the only one with rights to access it.
Any hints on where to look? I've tried enabling and disabling sudo in my hosts file, makes no difference.
Command I run:
ansible-playbook site.yml -i hosts.yml -vvvv -u ubuntu
Outputs this and hangs:
<cb2> ESTABLISH CONNECTION FOR USER: ubuntu
<cb2> REMOTE_MODULE setup
<cb2> EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/alexweinstein/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 cb2 /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'
Note that I can ssh to the box just fine. Using ansible 1.9.4.
ADDITIONAL INFO:
- When I try to ssh into the box using the same exact ssh command as what ansible is outputting (see below), the connection goes thru just fine:
ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/Users/alexweinstein/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ubuntu -o ConnectTimeout=10 cb2
- Ping command hangs at the same exact point.
ansible all -i hosts.yml -m ping -vvvv
ANSIBLE_DEBUG=1
in the beginning of your command and run playbook again, you should get some useful output. – Konstantin Suvorov--ask-pass
. This will make ansible ask you the password for SSH login. Also, try running ping on the host usingansible all -i hosts.yml -m ping
– Ashray Mehta