# Simple Ansible ping failing

**URL:** <https://forum.ansible.com/t/simple-ansible-ping-failing/15655>\
**Category:** Ansible Project\
**Tags:** fedora\
**Created:** [July 12, 2014, 12:49pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655 "2014-07-12T12:49:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_Jones](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Chris\_Jones](https://forum.ansible.com/u/Chris_Jones)\
**Post date:** [July 12, 2014, 12:49pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/1 "2014-07-12T12:49:19Z")

</div>

Environments:

- 2 VMs (one VirtualBox with CentOS 7 and one Fusion with Fedora 20)  
-Python 2.7.5  
-Ansible 1.6.6 installed via PIP  
-host file with IP of other VM  
-ssh works fine in both directions  
-sftp on both vms  
-sudo user on both vms  
-ssh-key-gen on centos 7 vm and copied to fedora vm in authorized\_keys (tested ssh w/o password and it works)

The following command works:  
ansible all -m ping -vvvv -c local

The following command fails:  
ansible all -m ping -vvvv

— Begin output ----

192.168.1.233\> ESTABLISH CONNECTION FOR USER: cjones  
\<192.168.1.233\> REMOTE\_MODULE ping  
\<192.168.1.233\> EXEC [‘ssh’, ‘-C’, ‘-tt’, ‘-vvv’, ‘-o’, ‘ControlMaster=auto’, ‘-o’, ‘ControlPersist=60s’, ‘-o’, ‘ControlPath=/home/cjones/.ansible/cp/ansible-ssh-%h-%p-%r’, ‘-o’, ‘KbdInteractiveAuthentication=no’, ‘-o’, ‘PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey’, ‘-o’, ‘PasswordAuthentication=no’, ‘-o’, ‘ConnectTimeout=10’, ‘192.168.1.233’, “/bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1405139922.21-267195074145055 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1405139922.21-267195074145055 && echo $HOME/.ansible/tmp/ansible-tmp-1405139922.21-267195074145055’”]  
\<192.168.1.233\> PUT /tmp/tmpa1DdNK TO /home/cjones/.ansible/tmp/ansible-tmp-1405139922.21-267195074145055/ping  
192.168.1.233 | FAILED =\> failed to transfer file to /home/cjones/.ansible/tmp/ansible-tmp-1405139922.21-267195074145055/ping:

Received message too long 1097295214

---- End output ----

Suggestions? What gives? This is taking way too long to evaluate ☹

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 12, 2014, 12:52pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/2 "2014-07-12T12:52:52Z")

</div>

Try running with -vvvv if you are using the OpenSSH (-c ssh, or the default on mostly all but CentOS/RHEL control machines) and it will provide some expanded detail for starters.

Seems to be a permissions problem on your homedir though.

---

<div class="post-metadata">

**Author:** ![Chris\_Jones](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Chris\_Jones](https://forum.ansible.com/u/Chris_Jones)\
**Post date:** [July 12, 2014, 1:03pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/3 "2014-07-12T13:03:10Z")

</div>

**I did use -vvvv and I posted the output from it.**

I have looked at the docs and found them to be a little sparse on details but good at high-level concepts. They seem to leave out specific details with VERY specific how-tos to make sure simple things do not impede progress (not being critical - simply frustrated).

I also tried -c ssh and -c paramiko with no luck.

If there is a permission’s issue then what would be the suggested fix and where in the docs does it show a DETAILED example?

thx

---

<div class="post-metadata">

**Author:** ![Chris\_Jones](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Chris\_Jones](https://forum.ansible.com/u/Chris_Jones)\
**Post date:** [July 12, 2014, 1:06pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/4 "2014-07-12T13:06:32Z")

</div>

Follow on…  
Should an ssh key put on the controller host from each node host OR just each node host from the controller host?

thx

---

<div class="post-metadata">

**Author:** ![Brian\_Coca1](https://avatars.discourse-cdn.com/v4/letter/b/278dde/32.png) [@Brian\_Coca1](https://forum.ansible.com/u/Brian_Coca1)\
**Post date:** [July 12, 2014, 1:32pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/5 "2014-07-12T13:32:09Z")

</div>

The way ssh with keys works is that the machine you want to logon FROM has  
to have a private key, hosts you want to log TO have to have the public  
version of that key.

to test that it is working just use the ssh command itself, if that works,  
ansible should work also.

---

<div class="post-metadata">

**Author:** ![Chris\_Jones](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Chris\_Jones](https://forum.ansible.com/u/Chris_Jones)\
**Post date:** [July 12, 2014, 1:45pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/6 "2014-07-12T13:45:14Z")

</div>

Thanks. As I stated in the opening post, the password-less ssh is working from the controller to the node as expected so I would expect ansible to work.

I also included the output from -vvvv which shows ansible is trying to work but ALWAYS returns ‘FAILED =\> failed to transfer file to /home/cjones/.ansible/tmp/…/(whatever module I try): Received message too long …’

These are two virgin VMs setup with yum updates, ansible installed via pip, python 2.7.5, centos 7 (controller) and fedora 20 (node) [note: started the other way but had the same issues so we thought we would try making centos 7 the controller and fedora the node]. Maybe we kill fedora all together but I thought it would work with fedora.

Ansible is currently on both VMs but I understand it does not have to be (see previous paragraph note on why it is installed on both).

Also, when I look at the .ansible/tmp/… on the node machine the tmp directories exist from each command I run but nothing is in any directory.

I’m at a lost!!!

thanks

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [July 12, 2014, 2:08pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/7 "2014-07-12T14:08:17Z")

</div>

Typically this is caused by having something in your .bashrc or similar that is echoing text. See [http://www.snailbook.com/faq/sftp-corruption.auto.html](http://www.snailbook.com/faq/sftp-corruption.auto.html)

---

<div class="post-metadata">

**Author:** ![Chris\_Jones](https://avatars.discourse-cdn.com/v4/letter/c/edb3f5/32.png) [@Chris\_Jones](https://forum.ansible.com/u/Chris_Jones)\
**Post date:** [July 12, 2014, 3:12pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/8 "2014-07-12T15:12:53Z")

</div>

Matt THANKS!

I thought it was Fedora as a node that was causing an issue but your suggest was spot on! I had a SSH\_AGENT script in the .bashrc file so I removed it and it worked.

Thanks

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [July 13, 2014, 6:36pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/9 "2014-07-13T18:36:52Z")

</div>

If that’s all you are getting from -vvvv this implies you are using paramiko (Enterprise Linux default), and not openssh. Try it with an explicit -c ssh and let’s see if you get more detail. You won’t want to run this normally but may provide more detail.

---

<div class="post-metadata">

**Author:** ![markmonizhpe](https://avatars.discourse-cdn.com/v4/letter/m/898d66/32.png) [@markmonizhpe](https://forum.ansible.com/u/markmonizhpe)\
**Post date:** [May 1, 2019, 11:14pm UTC](https://forum.ansible.com/t/simple-ansible-ping-failing/15655/10 "2019-05-01T23:14:54Z")

</div>

I am aware that this is 5 years old but I had a similar problem that was caused by my ~/.ssh/config file. This post is what helped me find my solution.

If anyone else is having this issue, add  
`ssh_args = -F /dev/null`  
to your /etc/ansible/ansible.cf
