title: Ansible Wait_For Module
body: <p>I created a playbook to reboot my remote servers. I use wait_for to wait for remote servers up before I continue. So I have the following code:</p>
  
  <pre><code>—-
  - hosts: hostName
    tasks:
      - name: reboot
        shell: reboot
        async: 1
        poll: 0
  
      - name: wait for server to come up
        Local_action: wait_for
        args:
        host: hostName
        port: 22
        state: started
        delay: 10
        timeout: 600
  </code></pre>
  
  <p>My targeted server was up about 5 minutes after reboot was initiated. However, the playbook stacked at this play till it timed out and generated error. </p>
  
  <p>My questions are:
   1. How doeS wait_for work here? Does it send ssh connection request to target host and time out if it cannot connect to the target host after 600 seconds? Or does it keep pinging the target host till it times out?
   2.What could be the problem I am having?</p>