Here is a problem that’s driving me crazy for the last 10 hours and I can’t sort it.
Let’s call it PC1 and I use this:
ansible -s -K -i hosts -m setup host1 -u username -vvvv
This is running just fine and delivers all the facts.
Now let’s run this on the same PC1:
ansible-playbook -K -i hosts test.yml -u username -vvvv
test.yml has the following content:
- name: “Gather Facts”
hosts: host1
connection: ssh
gather_facts: true
sudo: yes
That is hanging indefinitely. The output is like this:
EXEC [‘ssh’, ‘-tt’, ‘-vvv’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/tmp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘Port=22’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘User=username’, ‘-o’, ‘ConnectTimeout=10’, ‘host1’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1380631415.49-10764847459179 && chmod a+rx $HOME/.ansible/tmp/ansible-1380631415.49-10764847459179 && echo $HOME/.ansible/tmp/ansible-1380631415.49-10764847459179’”]
When running through ansible, the setup module is working fine. Running through ansible-playbook, we don’t get anything on the remote host. If we do the exactly same thing on another PC2, then both works fine. What could that be??? I hope anyone has an idea, I’m running out of them.