2017-05-18 23:10:07 +02:00
|
|
|
---
|
2018-07-07 19:37:56 +02:00
|
|
|
- block:
|
2019-01-09 21:51:48 +01:00
|
|
|
- name: Restart network
|
|
|
|
shell: sleep 2 && systemctl restart network
|
|
|
|
async: 1
|
|
|
|
poll: 0
|
2019-06-21 08:06:43 +02:00
|
|
|
ignore_errors: yes
|
2019-06-20 22:57:34 +02:00
|
|
|
when: not require_reboot | bool
|
2019-01-09 21:51:48 +01:00
|
|
|
listen: __network_restart
|
2017-05-18 23:10:07 +02:00
|
|
|
|
2019-01-09 21:51:48 +01:00
|
|
|
- name: Reboot server
|
|
|
|
shell: sleep 2 && shutdown -r now "Reboot triggered by Ansible"
|
|
|
|
async: 1
|
|
|
|
poll: 0
|
2019-06-21 08:06:43 +02:00
|
|
|
ignore_errors: yes
|
2019-06-20 22:57:34 +02:00
|
|
|
when: require_reboot | bool
|
2019-01-09 21:51:48 +01:00
|
|
|
listen: __host_reboot
|
2018-07-07 19:37:56 +02:00
|
|
|
become: True
|
2019-01-09 21:51:48 +01:00
|
|
|
become_user: root
|
2017-05-18 23:10:07 +02:00
|
|
|
|
2018-07-06 23:20:38 +02:00
|
|
|
- name: Waiting for host startup
|
|
|
|
wait_for_connection:
|
2018-07-02 00:39:35 +02:00
|
|
|
delay: 5
|
|
|
|
timeout: 300
|
2017-05-18 23:10:07 +02:00
|
|
|
listen:
|
2019-01-09 21:51:48 +01:00
|
|
|
- __network_restart
|
|
|
|
- __host_reboot
|