This commit is contained in:
2025-11-05 19:31:21 +02:00
parent effcf44f4c
commit fbe14f1a58

View File

@@ -642,30 +642,26 @@
ansible.builtin.debug: ansible.builtin.debug:
msg: "DEV2 firmux={{ (dev2_firmux.stdout | default('')) | trim }}" msg: "DEV2 firmux={{ (dev2_firmux.stdout | default('')) | trim }}"
# ====== INSERTED: two-step normalization preview (rev→r, then space→dash) ====== # ====== INSERTED: two-step normalization preview (plain debug only) ======
- name: Normalize DEV2 firmux (step 1): replace 'rev ' → 'r' - name: Normalize firmux step1 - replace 'rev ' with 'r'
when: dev2_firmux is defined
delegate_to: localhost delegate_to: localhost
ansible.builtin.set_fact: ansible.builtin.set_fact:
dev2_fw_norm_step1: "{{ (dev2_firmux.stdout | default('')) | trim | regex_replace('\\brev\\s+','r') }}" _firmux_step1: "{{ (dev2_firmux.stdout | default('') | trim) | regex_replace('\\brev\\s+', 'r') }}"
- name: Debug normalization step 1 output - name: Debug firmux step1 result
when: dev2_fw_norm_step1 is defined
delegate_to: localhost delegate_to: localhost
ansible.builtin.debug: ansible.builtin.debug:
msg: "step1={{ dev2_fw_norm_step1 }}" msg: "firmux_step1={{ _firmux_step1 | default('') }}"
- name: Normalize DEV2 firmux (step 2): replace space → '-' - name: Normalize firmux step2 - replace spaces with dashes
when: dev2_fw_norm_step1 is defined
delegate_to: localhost delegate_to: localhost
ansible.builtin.set_fact: ansible.builtin.set_fact:
dev2_fw_norm_step2: "{{ dev2_fw_norm_step1 | replace(' ', '-') }}" _firmux_step2: "{{ (_firmux_step1 | default((dev2_firmux.stdout | default('') | trim))) | regex_replace('\\s+', '-') }}"
- name: Debug normalization step 2 output - name: Debug firmux step2 result
when: dev2_fw_norm_step2 is defined
delegate_to: localhost delegate_to: localhost
ansible.builtin.debug: ansible.builtin.debug:
msg: "step2={{ dev2_fw_norm_step2 }}" msg: "firmux_step2={{ _firmux_step2 | default('') }}"
# ====== END INSERTED ====== # ====== END INSERTED ======
# ===================== Early equality/substring check (same logic as checker) ===================== # ===================== Early equality/substring check (same logic as checker) =====================
@@ -714,6 +710,7 @@
}} }}
changed_when: false changed_when: false
# 3) evaluate (same equality OR substring, case-insensitive)
- name: Evaluate version match using normalized equality or substring - name: Evaluate version match using normalized equality or substring
delegate_to: localhost delegate_to: localhost
ansible.builtin.set_fact: ansible.builtin.set_fact:
@@ -750,6 +747,7 @@
current_fw_core: "{{ banner_norm | default('') }}" current_fw_core: "{{ banner_norm | default('') }}"
changed_when: false changed_when: false
# If we are NOT blocked, still fill the legacy names so your later summary prints them
- name: Back-fill compare names for summary (no-op if already set) - name: Back-fill compare names for summary (no-op if already set)
when: not (_blocked | default(false)) when: not (_blocked | default(false))
ansible.builtin.set_fact: ansible.builtin.set_fact: