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:
2026-04-29 13:00:30 -07:00
parent 738c9dd4a0
commit 01b954e17f

View File

@@ -128,20 +128,36 @@
- name: Initiate system reboot - name: Initiate system reboot
ansible.builtin.raw: | ansible.builtin.raw: |
/sbin/reboot /sbin/reboot
ignore_unreachable: true
ignore_errors: true
when: when:
- perform_upgrade | bool - perform_upgrade | bool
- upgrade_successful - upgrade_successful | bool
- _reboot_check.stdout | trim == "REBOOT_NEEDED" - _reboot_check.stdout | trim == "REBOOT_NEEDED"
- name: Wait for system to come back online after reboot # - name: Wait for system to come back online after reboot
ansible.builtin.wait_for_connection: # ansible.builtin.wait_for_connection:
timeout: "{{ reboot_timeout | default(300) }}" # timeout: "{{ reboot_timeout | default(600) }}"
delay: 15 # 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: when:
- perform_upgrade | bool - perform_upgrade | bool
- upgrade_successful - upgrade_successful | bool
- _reboot_check.stdout | trim == "REBOOT_NEEDED" - _reboot_check.stdout | trim == "REBOOT_NEEDED"
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# 5. Final status and failure handling # 5. Final status and failure handling
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------