Simple Ansible ping failing

2,101 views
Skip to first unread message

Chris Jones

unread,
Jul 12, 2014, 8:49:19 AM7/12/14
to ansible...@googlegroups.com
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 :(



Michael DeHaan

unread,
Jul 12, 2014, 8:52:56 AM7/12/14
to ansible...@googlegroups.com
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.


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/41323394-c166-46a7-b231-c70799164a53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Jones

unread,
Jul 12, 2014, 9:03:11 AM7/12/14
to ansible...@googlegroups.com
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

Chris Jones

unread,
Jul 12, 2014, 9:06:32 AM7/12/14
to ansible...@googlegroups.com
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

Brian Coca

unread,
Jul 12, 2014, 9:32:15 AM7/12/14
to ansible...@googlegroups.com
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.


--
Brian Coca
Stultorum infinitus est numerus
0110000101110010011001010110111000100111011101000010000001111001011011110111010100100000011100110110110101100001011100100111010000100001
Pedo mellon a minno

Chris Jones

unread,
Jul 12, 2014, 9:45:15 AM7/12/14
to ansible...@googlegroups.com
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

Matt Martz

unread,
Jul 12, 2014, 10:09:03 AM7/12/14
to ansible...@googlegroups.com
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


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Chris Jones

unread,
Jul 12, 2014, 11:12:53 AM7/12/14
to ansible...@googlegroups.com
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

Michael DeHaan

unread,
Jul 13, 2014, 2:37:03 PM7/13/14
to ansible...@googlegroups.com
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.







markmo...@gmail.com

unread,
May 1, 2019, 7:14:55 PM5/1/19
to Ansible Project
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
Reply all
Reply to author
Forward
0 new messages