Compare commits
3 Commits
main
...
reboot_mod
Author | SHA1 | Date | |
---|---|---|---|
562868e187 | |||
f831e3a0cb | |||
16f8bdd07d |
@ -9,9 +9,19 @@
|
||||
verified_reboot_pre_boot_id: "{{ verified_reboot_pre_boot_id_raw['content'] | b64decode | trim }}"
|
||||
verified_reboot_check_count: 0
|
||||
|
||||
- name: Reboot the host
|
||||
ansible.builtin.command:
|
||||
cmd: "/usr/sbin/shutdown -r +{{ verified_reboot_reboot_time }} '{{ verified_reboot_reboot_msg }}'"
|
||||
- name: Reboot host using reboot module or fallback
|
||||
block:
|
||||
- name: Reboot the host [reboot module]
|
||||
ansible.builtin.reboot:
|
||||
msg: "{{ verified_reboot_reboot_msg }}"
|
||||
pre_reboot_delay: "{{ (verified_reboot_reboot_time ~ 'm') | community.general.to_seconds }}"
|
||||
connect_timeout: "{{ verified_reboot_wait_conn_timeout }}"
|
||||
reboot_timeout: "{{ verified_reboot_wait_delay }}"
|
||||
rescue:
|
||||
- name: Reboot the host [fallback]
|
||||
ansible.builtin.command:
|
||||
cmd: "/usr/sbin/shutdown -r +{{ verified_reboot_reboot_time }} '{{ verified_reboot_reboot_msg }}'"
|
||||
|
||||
- name: Verify reboot status of host
|
||||
ansible.builtin.include_tasks: check_boot_id.yml
|
||||
always:
|
||||
- name: Verify reboot status of host
|
||||
ansible.builtin.include_tasks: check_boot_id.yml
|
||||
|
Reference in New Issue
Block a user