This commit is contained in:
2025-10-22 22:42:53 +03:00
parent ae46bfcb3f
commit 800296fac8

View File

@@ -487,28 +487,21 @@
- name: Normalize rebootin detect now or integer HOURS - name: Normalize rebootin detect now or integer HOURS
delegate_to: localhost delegate_to: localhost
ansible.builtin.set_fact: ansible.builtin.set_fact:
_reboot_raw: "{{ rebootin | default('') | string | trim | lower }}" # treat rebootin as hours; consumer always passes a number (e.g., 4)
_reboot_is_now: "{{ (rebootin | default('') | string | trim | lower) in ['', 'now', 'immediate'] }}" _reboot_raw: "{{ rebootin | default('') | string | trim }}"
_reboot_is_int: "{{ (rebootin | default('') | string | trim) is match('^\\d+$') }}" _reboot_is_now: false
_reboot_hours: >- _reboot_is_int: "{{ (_reboot_raw | length) > 0 }}"
{{ _reboot_hours: "{{ rebootin | int }}"
0
if ((rebootin | default('') | string | trim | lower) in ['', 'now', 'immediate'])
else (rebootin | int if ((rebootin | default('') | string | trim) is match('^\\d+$')) else -1)
}}
- name: Debug reboot normalization detail - name: Debug reboot normalization detail
delegate_to: localhost delegate_to: localhost
ansible.builtin.debug: ansible.builtin.debug:
msg: msg:
- "_reboot_raw={{ _reboot_raw | default('UNSET') }}" - "_reboot_raw={{ _reboot_raw }}"
- "_reboot_is_now={{ _reboot_is_now | default('UNSET') }}" - "_reboot_is_now={{ _reboot_is_now }}"
- "_reboot_is_numtype={{ _reboot_is_numtype | default('UNSET') }}" - "_reboot_is_int={{ _reboot_is_int }}"
- "_reboot_is_digitstr={{ _reboot_is_digitstr | default('UNSET') }}" - "_reboot_hours={{ _reboot_hours }}"
- "_reboot_is_hsuffix={{ _reboot_is_hsuffix | default('UNSET') }}"
- "_reboot_hours={{ _reboot_hours | default('UNSET') }}"
- name: Warn if rebootin was not provided by consumer (debug only) - name: Warn if rebootin was not provided by consumer (debug only)
when: (rebootin | default('') | string | trim) == '' when: (rebootin | default('') | string | trim) == ''
@@ -1051,12 +1044,8 @@
- name: Derive expected target_version from image filename (strict X.Y.Z-rNNNN) - name: Derive expected target_version from image filename (strict X.Y.Z-rNNNN)
delegate_to: localhost delegate_to: localhost
ansible.builtin.set_fact: ansible.builtin.set_fact:
expected_fw_core: >- expected_fw_core: "{{ (image_filename | regex_search('[0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+')) | default('', true) }}"
{{
(image_filename | regex_search('([0-9]+\\.[0-9]+\\.[0-9]+-r[0-9]+)'))
| default('', true)
}}
when: au_delay_sec is defined
- name: Debug derived expected target_version for checker - name: Debug derived expected target_version for checker