Kai, thanks! The issue is that I’m really struggling to get the “wait_for” to work. I need to have the rebooted machine up before I boot the next one. Any good pointers to docs? Ansible docs say it can be done but don’t seem to show you how.
Task one is to async trigger the reboot
Task two the wait for ssh to come back (for each host in the play)
name: Reboot the system
shell: sleep 2 && shutdown -r now “Ansible reboot triggered”
become: True
async: 1
poll: 0
ignore_errors: true
FixMe: Trigger the wait for ssh on all the targets (long operation)
name: waiting for server to come back
wait_for:
host: “{{ inventory_hostname }}”
port: 22
delay: 15
timeout: 1200
connect_timeout: 15
state: started
delegate_to: localhost