12:42
This commit is contained in:
@@ -156,7 +156,8 @@
|
|||||||
echo "$p"; return 0
|
echo "$p"; return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
endfor=false
|
done
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
pick
|
pick
|
||||||
register: pick_port
|
register: pick_port
|
||||||
@@ -622,13 +623,29 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
expected_fw_core_early: "{{ (image_filename | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
|
expected_fw_core_early: "{{ (image_filename | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
|
||||||
|
|
||||||
# >>> CHANGE 1: Robust parse/normalize current firmware core from firmux <<<
|
- name: Parse current firmware core from DEV2 firmux (early, '-rNNNN' form)
|
||||||
- name: Parse current firmware core from DEV2 firmux (early, normalize 'rev' → '-r')
|
|
||||||
when: dev2_firmux is defined
|
when: dev2_firmux is defined
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_firmux_norm: "{{ (dev2_firmux.stdout | default('') | trim | lower | regex_replace('\\s*rev\\s*','-r')) }}"
|
current_fw_core_dash: "{{ (dev2_firmux.stdout | default('') | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
|
||||||
current_fw_core: "{{ (_firmux_norm | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
|
|
||||||
|
- name: Parse current firmware core from DEV2 firmux (alt 'X.Y.Z rev NNNN' → 'X.Y.Z-rNNNN')
|
||||||
|
when: dev2_firmux is defined and (current_fw_core_dash | length) == 0
|
||||||
|
delegate_to: localhost
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
current_fw_core_rev_parts: "{{ (dev2_firmux.stdout | default('') | regex_search('([0-9]+\\.[0-9]+\\.[0-9]+)\\s+rev\\s+([0-9]+)')) | default('', true) }}"
|
||||||
|
|
||||||
|
- name: Normalize current firmware core (prefer '-r' form; else build from 'rev')
|
||||||
|
delegate_to: localhost
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
current_fw_core: >-
|
||||||
|
{% if (current_fw_core_dash | default('') | length) > 0 -%}
|
||||||
|
{{ current_fw_core_dash }}
|
||||||
|
{%- elif (current_fw_core_rev_parts | default('') | length) > 0 -%}
|
||||||
|
{{ (dev2_firmux.stdout | regex_replace('.*([0-9]+\\.[0-9]+\\.[0-9]+)\\s+rev\\s+([0-9]+).*','\\1-r\\2')) }}
|
||||||
|
{%- else -%}
|
||||||
|
{{ '' }}
|
||||||
|
{%- endif %}
|
||||||
|
|
||||||
- name: Soft-block if current firmware already matches target (skip staging/write/flip)
|
- name: Soft-block if current firmware already matches target (skip staging/write/flip)
|
||||||
when:
|
when:
|
||||||
@@ -758,12 +775,12 @@
|
|||||||
register: local_md5
|
register: local_md5
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
# >>> CHANGE 2: Local md5 mismatch is a SOFT-BLOCK, not a hard assert <<<
|
# **** CHANGE: MD5 mismatch becomes SOFT-BLOCK (no assert) ****
|
||||||
- name: Soft-block if local md5 does not match expected
|
- name: Soft-block if local md5 does not match expected
|
||||||
when: local_img.stat.exists and ((local_md5.stdout | trim) != image_md5)
|
when: local_img.stat.exists and ((local_md5.stdout | trim) != image_md5)
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_prep_blocked: true
|
|
||||||
_blocked: true
|
_blocked: true
|
||||||
|
_prep_blocked: true
|
||||||
_journal: "{{ _journal + [ 'Local md5 mismatch: have=' ~ (local_md5.stdout | trim) ~ ' expected=' ~ image_md5 ] }}"
|
_journal: "{{ _journal + [ 'Local md5 mismatch: have=' ~ (local_md5.stdout | trim) ~ ' expected=' ~ image_md5 ] }}"
|
||||||
|
|
||||||
# Optional SHA256 local
|
# Optional SHA256 local
|
||||||
|
|||||||
Reference in New Issue
Block a user