>
> It waits for seconds before starting to test, and then it tests for 5
> minutes, before it fails.
>
> Settings this to 'delay=15 timeout=30‘ should speed things up, because
> it fails after 45s if the host is not reachable. Also, setting a
> smaller delay works, if your host is rebooting that quickly. If it
> needs some minutes to reboot, you obviously need other values...
>

I see. I guess a found a good default for my case, which would be:

- name: reboot system if required
  shell: removes=/var/run/reboot-required sleep 2 && shutdown -r now
  async: 1
  poll: 0
  ignore_errors: true

- name: wait for server to come back
  local_action: wait_for host={{ inventory_hostname }} state=started
delay=5 timeout=30

So right now it correctly waits for the server to come back.

Is it possible to add a condition on the wait task in order to skip it if a
reboot was not required?

Regards,
Francisco

On Fri, May 27, 2016 at 3:45 PM, Johannes Kastl <[email protected]> wrote:

> On 27.05.16 20:24 Francisco Lopes wrote:
>
> > - name: wait for server to come back
> >   local_action: wait_for host={{ inventory_hostname }} state=started
> > delay=30 timeout=300
> >
> > This hangs on the waiting task, even though the servers are back online.
>
> It waits for seconds before starting to test, and then it tests for 5
> minutes, before it fails.
>
> Settings this to 'delay=15 timeout=30‘ should speed things up, because
> it fails after 45s if the host is not reachable. Also, setting a
> smaller delay works, if your host is rebooting that quickly. If it
> needs some minutes to reboot, you obviously need other values...
>
> Johannes
>
> --
> 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/574895E7.1040303%40ojkastl.de
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAKK1Gd%2BpV6j29yLFfNWuX%2BAY42m2y1wchFabuVc2pRCNbGL%3Dtw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to