- ---
- # Role to reboot a server
- - name: Restart server
- shell: sleep 2 && shutdown -r now "Ansible updates triggered"
- async: 1
- poll: 0
- ignore_errors: true
- - name: Wait for server to restart
- local_action:
- module: wait_for
- host={{ ansible_ssh_host }}
- port=22
- delay=3
- timeout=300
- sudo: false
|