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,18 +128,34 @@
|
|||||||
- 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"
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user