ansible-development-environ.../roles/reboot/tasks/reboot.yml

21 lines
545 B
YAML

---
- name: flush notified handlers
ansible.builtin.meta: flush_handlers
- name: reboot the machine
ansible.builtin.shell: "(sleep {{ reboot_delay }} && {{ reboot_command }} &)" # noqa 301 This was before the reboot module existed.
async: 1
poll: 0
ignore_errors: yes
- name: 1 wait for the start of reboot
ansible.builtin.pause:
seconds: "{{ reboot_delay }}"
- name: 2 wait for the machine to be up
ansible.builtin.wait_for:
delay: "{{ reboot_up_delay }}"
- name: 3 gather facts after reboot
ansible.builtin.setup: