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 

-- 
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 [email protected].
To post to this group, send email to [email protected].
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.

Reply via email to