ssh works for first few tasks then fails (on different tasks each attempt)

43 views
Skip to first unread message

David Whiteside

unread,
Nov 23, 2014, 6:53:36 PM11/23/14
to ansible...@googlegroups.com
It worked at ansible v1.5, now I have the occasional issue below with the latest version 1.7.2. Manually sshing never has any issues.
 
$ ansible-playbook -s -i ./inventoryfile plays.yml -vvvv

PLAY [webserver] ************************************************************** 

GATHERING FACTS *************************************************************** 
ok: [webserver]

TASK: [webserver | Install nginx] ********************************************* 
ok: [webserver] => {"changed": false}

TASK: [webserver | start nginx] *********************************************** 
ok: [webserver] => {"changed": false, "enabled": true, "name": "nginx", "state": "started"}

TASK: [webserver | configure default webpage for nginx] *********************** 
<HOSTNAME> ESTABLISH CONNECTION FOR USER: ubuntu
<HOSTNAME> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'CheckHostIP=no', '-o', 'StrictHostKeyChecking=no', '-i', '/home/ubuntu/.ssh/mykey', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', u'HOSTNAME', u'/bin/sh -c \'sudo -k && sudo -H -S -p "[sudo via ansible, key=byvvbhgjlxzbdlcslyfnckefapqkxjpm] password: " -u root /bin/sh -c \'"\'"\'echo SUDO-SUCCESS-byvvbhgjlxzbdlcslyfnckefapqkxjpm; rc=0; [ -r "/usr/share/nginx/www/index.html" ] || rc=2; [ -f "/usr/share/nginx/www/index.html" ] || rc=1; [ -d "/usr/share/nginx/www/index.html" ] && echo 3 && exit 0; (/usr/bin/md5sum /usr/share/nginx/www/index.html 2>/dev/null) || (/sbin/md5sum -q /usr/share/nginx/www/index.html 2>/dev/null) || (/usr/bin/digest -a md5 /usr/share/nginx/www/index.html 2>/dev/null) || (/sbin/md5 -q /usr/share/nginx/www/index.html 2>/dev/null) || (/usr/bin/md5 -n /usr/share/nginx/www/index.html 2>/dev/null) || (/bin/md5 -q /usr/share/nginx/www/index.html 2>/dev/null) || (/usr/bin/csum -h MD5 /usr/share/nginx/www/index.html 2>/dev/null) || (/bin/csum -h MD5 /usr/share/nginx/www/index.html 2>/dev/null) || (echo "${rc} /usr/share/nginx/www/index.html")\'"\'"\'\'']
<HOSTNAME> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'UserKnownHostsFile=/dev/null', '-o', 'CheckHostIP=no', '-o', 'StrictHostKeyChecking=no', '-i', '/home/ubuntu/.ssh/mykey', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', u'HOSTNAME', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1416786433.51-62781121556067 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1416786433.51-62781121556067 && echo $HOME/.ansible/tmp/ansible-tmp-1416786433.51-62781121556067'"]
fatal: [webserver] => SSH encountered an unknown error. The output was:
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/ubuntu/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to HOSTNAME [HOSTNAME] port 22.
debug2: fd 3 setting O_NONBLOCK
debug1: connect to address HOSTNAME port 22: Connection refused
ssh: connect to host HOSTNAME port 22: Connection refused


FATAL: all hosts have already failed -- aborting

PLAY RECAP ******************************************************************** 
           to retry, use: --limit @/home/ubuntu/webserver.retry

webserver                  : ok=3    changed=0    unreachable=1    failed=0 

Michael DeHaan

unread,
Nov 24, 2014, 5:46:50 PM11/24/14
to ansible...@googlegroups.com
Hmm, that's interesting - possibly a network issue of some kind related to a router being overwhelmed or something?



--
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/b673e279-8b52-417c-a9dd-efbcc332cf0b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Whiteside

unread,
Nov 24, 2014, 6:08:48 PM11/24/14
to ansible...@googlegroups.com
I am connecting from a c9.io dev environment to a google compute
server. This morning it happened much less frequently, so I believe
you are correct. I was also able to verify it happens even when using
ssh on the command line, so definitely environmental and not OpenSSH
or Ansible specific.

-David
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/qnerRy1ovQM/unsubscribe.
> To unsubscribe from this group and all its topics, 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/CA%2BnsWgzjC7eieNuMC5P_tnN-nfL2RiyqautzQM-r5YK%2BWwNKAA%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/d/optout.



--
-------
David L Whiteside
Reply all
Reply to author
Forward
0 new messages