Ansible sometimes encountered error 'SSH encountered an unknown error during the connection. '
283 views
Skip to first unread message
于杨
unread,
Jan 21, 2015, 2:45:10 AM1/21/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
I am pretty sure the private key and user are correct for ansible script because we only occasionally see this error. So I suspect the network connection can not be reached sometimes or SSH service is not started on remote server. So before ansible playbook ran, I want to call ping module to make sure network connection is ok, but I do not know if ansible has a module can check ssh service is ok, does telnet module work?
Brian Coca
unread,
Jan 21, 2015, 9:33:57 AM1/21/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to ansible...@googlegroups.com
wait_for can check if a port is open, the ping module actually uses
the ssh connection, it can be used with do/until to make sure the
machine is up.