28 lines
593 B
YAML
28 lines
593 B
YAML
---
|
|
- block:
|
|
- name: Restart network
|
|
shell: sleep 2 && systemctl restart network
|
|
async: 1
|
|
poll: 0
|
|
ignore_errors: true
|
|
when: not require_reboot
|
|
listen: __network_restart
|
|
|
|
- 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
|
|
become_user: root
|
|
|
|
- name: Waiting for host startup
|
|
wait_for_connection:
|
|
delay: 5
|
|
timeout: 300
|
|
listen:
|
|
- __network_restart
|
|
- __host_reboot
|