This commit is contained in:
2026-03-02 11:29:19 +02:00
parent 15c034be34
commit 9f2500d393

View File

@@ -55,7 +55,7 @@
- name: Stop if connected hostname differs from inventory - name: Stop if connected hostname differs from inventory
ansible.builtin.fail: ansible.builtin.fail:
msg: "Aborting: connected host reported hostname '{{ host_env.stdout | trim }}' which differs from inventory '{{ inventory_hostname }}'." msg: "Backup-bank prep aborting: connected host reported hostname '{{ host_env.stdout | trim }}' which differs from inventory '{{ inventory_hostname }}'."
when: (host_env.stdout | trim) != inventory_hostname when: (host_env.stdout | trim) != inventory_hostname
rescue: rescue:
@@ -72,7 +72,7 @@
- name: Build failure summary text (hostname preflight) - name: Build failure summary text (hostname preflight)
ansible.builtin.set_fact: ansible.builtin.set_fact:
fail_summary: >- fail_summary: >-
Firmware update aborted at '{{ fail_task_name }}': {{ fail_detail_raw }} Outdoor backup preparation aborted at '{{ fail_task_name }}': {{ fail_detail_raw }}
- name: Truncate failure summary to ~400 chars (hostname preflight) - name: Truncate failure summary to ~400 chars (hostname preflight)
ansible.builtin.set_fact: ansible.builtin.set_fact:
@@ -295,9 +295,9 @@
"inscope_device": (ansible_hostname | default(inventory_hostname)), "inscope_device": (ansible_hostname | default(inventory_hostname)),
"task_name": "journal_add", "task_name": "journal_add",
"task_result": ( "task_result": (
"Preparation already present for " ~ fw_banner_repr ~ "Backup preparation already present for " ~ fw_banner_repr ~
"; marker " ~ fw_marker ~ "; marker " ~ fw_marker ~
". Skipping update steps." ". Skipping backup preparation steps."
) )
} | to_json } | to_json
}} }}
@@ -398,7 +398,7 @@
- name: Stop if bootloader environment looks invalid (<7 lines) - name: Stop if bootloader environment looks invalid (<7 lines)
ansible.builtin.fail: ansible.builtin.fail:
msg: "Aborting: fw_printenv returned only {{ env_line_count.stdout | trim }} lines (<7) — environment missing or corrupted." msg: "Backup-bank prep aborting: fw_printenv returned only {{ env_line_count.stdout | trim }} lines (<7) — environment missing or corrupted."
when: (env_line_count.stdout | trim | int) < 7 when: (env_line_count.stdout | trim | int) < 7
- name: Read first line of /etc/banner (current running version) - name: Read first line of /etc/banner (current running version)
@@ -409,11 +409,15 @@
- name: current version - name: current version
ansible.builtin.debug: ansible.builtin.debug:
msg: msg:
- "current banner: {{ banner.stdout | trim }}" - "current running (primary) banner: {{ banner.stdout | trim }}"
- name: Stop if target version matches current (/etc/banner already at {{ fw_banner_repr }}) - name: Stop if target version matches current (/etc/banner already at {{ fw_banner_repr }})
ansible.builtin.fail: ansible.builtin.debug:
msg: "Aborting: device already runs {{ fw_banner_repr }} (banner: {{ banner.stdout | trim }})" msg: "Backup-bank prep skip: running (primary) already at {{ fw_banner_repr }} (banner: {{ banner.stdout | trim }}). This playbook prepares backup bootbank only (no flip, no reboot)."
when: banner.stdout is search(fw_banner_repr)
- name: End play for this host (target already running on primary; backup prep not needed)
ansible.builtin.meta: end_host
when: banner.stdout is search(fw_banner_repr) when: banner.stdout is search(fw_banner_repr)
- name: Upload firmware to /tmp via scp (controller-side) - name: Upload firmware to /tmp via scp (controller-side)
@@ -736,7 +740,7 @@
- name: Build failure summary text - name: Build failure summary text
ansible.builtin.set_fact: ansible.builtin.set_fact:
fail_summary: >- fail_summary: >-
Firmware update aborted at '{{ fail_task_name }}': {{ fail_detail_raw }} Outdoor backup preparation aborted at '{{ fail_task_name }}': {{ fail_detail_raw }}
- name: Truncate failure summary to ~400 chars - name: Truncate failure summary to ~400 chars
ansible.builtin.set_fact: ansible.builtin.set_fact:
@@ -845,4 +849,4 @@
- name: Scheduler | Debug action_state failed published (update failure) - name: Scheduler | Debug action_state failed published (update failure)
ansible.builtin.debug: ansible.builtin.debug:
msg: "scheduler-run detected; published action_state=failed (update failure)" msg: "scheduler-run detected; published action_state=failed (update failure)"
when: is_run_by_effective == 'scheduler' when: is_run_by_effective == 'scheduler'