Setup wait conditions for system to come back on line.
Removed wait_for_connection as it requires python not present on pfsense.
This commit is contained in:
@@ -128,20 +128,36 @@
|
||||
- name: Initiate system reboot
|
||||
ansible.builtin.raw: |
|
||||
/sbin/reboot
|
||||
ignore_unreachable: true
|
||||
ignore_errors: true
|
||||
when:
|
||||
- perform_upgrade | bool
|
||||
- upgrade_successful
|
||||
- upgrade_successful | bool
|
||||
- _reboot_check.stdout | trim == "REBOOT_NEEDED"
|
||||
|
||||
- name: Wait for system to come back online after reboot
|
||||
ansible.builtin.wait_for_connection:
|
||||
timeout: "{{ reboot_timeout | default(300) }}"
|
||||
delay: 15
|
||||
# - name: Wait for system to come back online after reboot
|
||||
# ansible.builtin.wait_for_connection:
|
||||
# timeout: "{{ reboot_timeout | default(600) }}"
|
||||
# delay: 15
|
||||
# when:
|
||||
# - perform_upgrade | bool
|
||||
# - upgrade_successful | bool
|
||||
# - _reboot_check.stdout | trim == "REBOOT_NEEDED"
|
||||
|
||||
- name: Wait for system to come back online (raw ping loop)
|
||||
ansible.builtin.raw: |
|
||||
for i in 1 2 3 4 5 6 7 8 9 10 11 12; do
|
||||
sleep 10
|
||||
/sbin/ping -c 1 -t 2 8.8.8.8 > /dev/null 2>&1 && exit 0
|
||||
done
|
||||
exit 1
|
||||
register: _wait_result
|
||||
ignore_errors: true
|
||||
when:
|
||||
- perform_upgrade | bool
|
||||
- upgrade_successful
|
||||
- upgrade_successful | bool
|
||||
- _reboot_check.stdout | trim == "REBOOT_NEEDED"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# 5. Final status and failure handling
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user