---
- hosts: '{{ host }}'
  gather_facts: no
  tasks:
  - name: reboot machine
    command: /sbin/reboot

  - name: waiting for machine to come back
    local_action: wait_for host={{ ansible_ssh_host }} port={{ 
ansible_ssh_port }} delay=30 timeout=180 state=started

  - command: echo "X"


This fails with;


$ ansible-playbook tasks/reboot-and-wait.yml -e "host=node"

PLAY [node] **************************************************************

TASK: [reboot machine] 
********************************************************
changed: [node]

TASK: [waiting for machine to come back] 
**************************************
ok: [node]

TASK: [command echo "X"] 
******************************************************
No handlers could be found for logger "paramiko.transport"
fatal: [node] => {'msg': 'FAILED: Error reading SSH protocol banner', 
'failed': True}

FATAL: all hosts have already failed -- aborting

PLAY RECAP 
********************************************************************
           to retry, use: --limit @/root/reboot-and-wait.retry

svnserver                  : ok=2    changed=1    unreachable=1    failed=0


I can add additional delay, but I want to connect as soon as possible. Is 
there a way to check that not only port if open, but service on remote end 
is also up?

-- 
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/6dad156d-640d-494b-bb04-39440d13332b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to