Can't Ping - Failed to transfer file to...

131 views
Skip to first unread message

Ivan Ferrera

unread,
Dec 14, 2015, 5:38:41 PM12/14/15
to Ansible Project
Hi, I have something echoing in /etc/bashrc; need some guidance here.

absible.cfg:
scp_if_ssh = True

hosts:
[myhosts]
host.mydomain.com ansible_connection=ssh ansible_ssh_user=ec2-user ansible_ssh_private_key_file=/home/ec2-user/.ssh/id_rsa

Output of ansible -i hosts myhosts -m ping -vvvv:
-------------------------------
<host.mydomain.com> ESTABLISH CONNECTION FOR USER: ec2-user
<host.mydomain.com> REMOTE_MODULE ping
<host.mydomain.com> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/ec2-user/.ansible/cp/ansible-ssh-%h-%p-%r" -o IdentityFile="/home/ec2-user/.ssh/id_rsa" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 host.mydomain.com /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1450128709.26-37707891136005 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1450128709.26-37707891136005 && echo $HOME/.ansible/tmp/ansible-tmp-1450128709.26-37707891136005'
<host.mydomain.com> PUT /tmp/tmpQ6fYEm TO /home/ec2-user/.ansible/tmp/ansible-tmp-1450128709.26-37707891136005/ping
host.mydomain.com | FAILED => failed to transfer file to /home/ec2-user/.ansible/tmp/ansible-tmp-1450128709.26-37707891136005/ping:

Agent pid 8554
-------------------------------
Applicable section of /etc/bashrc:

SSHAGENT=/usr/bin/ssh-agent
SSHAGENTARGS="-s"
if [ -z "$SSH_AUTH_SOCK" -a -x "$SSHAGENT" ]; then
eval `$SSHAGENT $SSHAGENTARGS`
trap "kill $SSH_AGENT_PID" 0
fi

Is there a workaround for ssh that echos something after login?

Matt Martz

unread,
Dec 14, 2015, 6:02:18 PM12/14/15
to ansible...@googlegroups.com
You could either add redirection to send output to /Dev/null or do something like checking whether it is an interactive session before running some commands:


--
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/43f96a64-27f2-433a-930b-6446569b9c67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Matt Martz
@sivel
sivel.net

Ivan Ferrera

unread,
Dec 14, 2015, 6:47:34 PM12/14/15
to Ansible Project
Awesome, I checked for, and only displayed on interactive session and works now; thanks!



To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscribe@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages