12:27
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
---
|
|
||||||
# update-indoor.yml (conservative, minimal fixes)
|
# update-indoor.yml (conservative, minimal fixes)
|
||||||
- name: Second-line indoor upgrade via DEV1 → tunnel → DEV2 (non-invasive control path)
|
- name: Second-line indoor upgrade via DEV1 → tunnel → DEV2 (non-invasive control path)
|
||||||
hosts: all
|
hosts: all
|
||||||
@@ -157,9 +156,8 @@
|
|||||||
echo "$p"; return 0
|
echo "$p"; return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
endfor=false
|
||||||
return 1
|
}
|
||||||
}
|
|
||||||
pick
|
pick
|
||||||
register: pick_port
|
register: pick_port
|
||||||
changed_when: false
|
changed_when: false
|
||||||
@@ -559,13 +557,6 @@
|
|||||||
_prep_blocked: false
|
_prep_blocked: false
|
||||||
_blocked: false
|
_blocked: false
|
||||||
|
|
||||||
# >>> NEW: soft-block on auth failure (no valid credentials) <<<
|
|
||||||
- name: Soft-block if DEV2 auth failed (no valid credentials)
|
|
||||||
when: dev2_passfile_used == "NONE"
|
|
||||||
ansible.builtin.set_fact:
|
|
||||||
_blocked: true
|
|
||||||
_journal: "{{ (_journal | default([])) + [ 'No valid credentials for DEV2; skipping staging/write/flip' ] }}"
|
|
||||||
|
|
||||||
- name: Build specific image marker path on DEV2 (/tmp/prepared_for_<image>)
|
- name: Build specific image marker path on DEV2 (/tmp/prepared_for_<image>)
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_marker_specific: "/tmp/prepared_for_{{ image_filename | regex_replace('\\.bin$','') }}"
|
_marker_specific: "/tmp/prepared_for_{{ image_filename | regex_replace('\\.bin$','') }}"
|
||||||
@@ -631,11 +622,13 @@
|
|||||||
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) }}"
|
||||||
|
|
||||||
- name: Parse current firmware core from DEV2 firmux (early)
|
# >>> CHANGE 1: Robust parse/normalize current firmware core from firmux <<<
|
||||||
|
- 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:
|
||||||
current_fw_core: "{{ (dev2_firmux.stdout | default('') | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
|
_firmux_norm: "{{ (dev2_firmux.stdout | default('') | trim | lower | regex_replace('\\s*rev\\s*','-r')) }}"
|
||||||
|
current_fw_core: "{{ (_firmux_norm | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
|
||||||
|
|
||||||
- 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:
|
||||||
@@ -765,18 +758,13 @@
|
|||||||
register: local_md5
|
register: local_md5
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|
||||||
# >>> CHANGED: soft-block on local md5 mismatch; debug on match <<<
|
# >>> CHANGE 2: Local md5 mismatch is a SOFT-BLOCK, not a hard assert <<<
|
||||||
- name: Local md5 matches expected (debug)
|
|
||||||
when: local_img.stat.exists and ((local_md5.stdout | trim) == image_md5)
|
|
||||||
delegate_to: localhost
|
|
||||||
ansible.builtin.debug:
|
|
||||||
msg: "Local md5 matches expected"
|
|
||||||
|
|
||||||
- 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
|
||||||
_journal: "{{ (_journal | default([])) + [ '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
|
||||||
- name: Compute local sha256 of the image (if provided)
|
- name: Compute local sha256 of the image (if provided)
|
||||||
|
|||||||
Reference in New Issue
Block a user