1

I had everything for the most part working the way I wanted. And then, I have not clue how this happened; none of my Ansible playbooks will connect to remote systems (It Just Hangs). I can SSH into them fine from command line, with any account.
Below is a Ansible Ping test. My localhost is fine, and playbooks will execute. but, not with my remote systems.
I've gone as far as removing all accounts, creating new keys, and reinstalling Ansible

ansible.cfg, is currently at default settings (which is nothing enabled), and I have cleared everything in ~/.ansible

**Remote System** 

[root@SELC01 ~]# ansible -vvv servers -m ping -u root --ask-pass -K
Using /etc/ansible/ansible.cfg as config file
SSH password: 
SUDO password[defaults to SSH password]: 
META: ran handlers
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system /ping.py
<10.6.16.106> ESTABLISH SSH CONNECTION FOR USER: root
<10.6.16.106> SSH: EXEC sshpass -d12 ssh -C -o ControlMaster=auto -o ControlPersist=60s -o User=root -o ConnectTimeout=10 -o ControlPath=/roo/.ansible/cp/13665ce0cd 10.6.16.106 '/bin/sh -c '"'"'echo ~ && sleep 0'"'"''


**LocalHost**

[root@SELC01 ~]# ansible -vvv localhost -m ping -u root --ask-pass -K
Using /etc/ansible/ansible.cfg as config file
SSH password: 
SUDO password[defaults to SSH password]: 
META: ran handlers
Using module file /usr/lib/python2.7/site-packages/ansible/modules/system/ping.py
<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: root
<127.0.0.1> EXEC /bin/sh -c 'echo ~ && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1496147239.75-82726750768823 `" && echo ansible-tmp-1496147239.75-82726750768823="` echo /root/.ansible/tmp/ansible-tmp-1496147239.75-82726750768823 `" ) && sleep 0'
<127.0.0.1> PUT /tmp/tmpklwEPM TO /root/.ansible/tmp/ansible-tmp-1496147239.75-82726750768823/ping.py
<127.0.0.1> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1496147239.75-82726750768823/ /root/.ansible/tmp/ansible-tmp-1496147239.75-82726750768823/ping.py && sleep 0'
<127.0.0.1> EXEC /bin/sh -c '/usr/bin/python2 /root/.ansible/tmp/ansible-tmp-1496147239.75-82726750768823/ping.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1496147239.75-82726750768823/" > /dev/null 2>&1 && sleep 0'
localhost | SUCCESS => {
    "changed": false, 
    "invocation": {
    "module_args": {
        "data": null
    }

thank you for your help.

  • Does this happen on all hosts? I occasionally also had the problem but only on one host. A reboot of this host helped, but I have no clue to what's the problem or how to reproduce this behaviour. – Sethos II May 30 '17 at 12:54
  • You seems to be running ansible from 'root' user and in your previous question you was running it as 'ansible' user. – AlexD May 30 '17 at 12:58
  • -o ControlPath=/roo/.ansible is that a typo for root ? – thrig May 30 '17 at 14:08
  • @SethosII - its with all Hosts, I've rebooted all systems, no change.... – SemperfiYEMX May 30 '17 at 16:31
  • @AlexD - correct, I was using ansible, but starting over, using root for now, most of my config is fairly basic. Just trying to keep it simple, while learning Ansible.... – SemperfiYEMX May 30 '17 at 16:31
3

I fixed it, known_hosts had an issue. I remove the 10.6.16.106, ssh-keygen -R 10.6.16.106 and , ran ansible ping, it added it back in , and it worked.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.