2017-05-18 21:10:07 +00:00
|
|
|
---
|
2018-07-07 17:37:56 +00:00
|
|
|
- block:
|
|
|
|
- name: Restart network
|
|
|
|
shell: sleep 2 && systemctl restart network
|
|
|
|
async: 1
|
|
|
|
poll: 0
|
|
|
|
ignore_errors: true
|
|
|
|
when: not require_reboot
|
|
|
|
listen:
|
|
|
|
- "network_restart"
|
2017-05-18 21:10:07 +00:00
|
|
|
|
2018-07-07 17:37:56 +00:00
|
|
|
- name: Reboot server
|
|
|
|
shell: sleep 2 && shutdown -r now "Reboot triggered by Ansible"
|
|
|
|
async: 1
|
|
|
|
poll: 0
|
|
|
|
ignore_errors: true
|
|
|
|
when: require_reboot
|
|
|
|
listen:
|
|
|
|
- "host_reboot"
|
|
|
|
become: True
|
2017-05-18 21:10:07 +00:00
|
|
|
|
2018-07-06 21:20:38 +00:00
|
|
|
- name: Waiting for host startup
|
|
|
|
wait_for_connection:
|
2018-07-01 22:39:35 +00:00
|
|
|
delay: 5
|
|
|
|
timeout: 300
|
2017-05-18 21:10:07 +00:00
|
|
|
listen:
|
|
|
|
- "network_restart"
|
|
|
|
- "host_reboot"
|