---

# https://support.ansible.com/hc/en-us/articles/201958037-Reboot-a-server-and-wait-for-it-to-come-back

- name: reboot host
  shell: sleep 2 && shutdown -r now "Ansible updates triggered"
  async: 1
  poll: 0
  become: yes
  ignore_errors: true

- name: wait for reboot
  local_action: wait_for host={{ inventory_hostname }} port=22 state=started delay=30
  become: no
