main.yaml 327 B

12345678910111213141516
  1. ---
  2. # Role to reboot a server
  3. - name: Restart server
  4. shell: sleep 2 && shutdown -r now "Ansible updates triggered"
  5. async: 1
  6. poll: 0
  7. ignore_errors: true
  8. - name: Wait for server to restart
  9. local_action:
  10. module: wait_for
  11. host={{ ansible_ssh_host }}
  12. port=22
  13. delay=3
  14. timeout=300
  15. sudo: false