But this is not rebooting and the local_action is being skipped. I have a condition here because if a reboot wasn't necessary, I don't want to wait for the delay.- name: reboot system if required command: removes=/var/run/reboot-required sleep 1 && shutdown -r now 'Rebooting to complete system upgrade' async: 1 poll: 0 ignore_errors: true register: reboot - name: wait for server to come back (if restarted) local_action: wait_for host={{ inventory_hostname }} state=started delay=1 timeout=300 when: reboot.unreachable is defined and reboot.unreachable
This...
> https://support.ansible.com/hc/en-us/articles/201958037-Reboot-a-server-and-wait-for-it-to-come-back
...works for me.
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/57488435.3050607%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.
From the command module documentation:
"It will not be processed through the shell, so variables like $HOME and operations like "<", ">", "|", and "&" will not work (use the shell module if you need these features)."
--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/cc37cbd9-40ef-ba02-49aa-1c19af681550%40olstad.com.
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/574895E7.1040303%40ojkastl.de.
--
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 ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/3658b971-0c8e-a0f5-8aa7-2edbcc2aeab7%40olstad.com.