This commit is contained in:
2025-10-23 12:36:08 +03:00
parent 15e2f5dddf
commit b5f3a70c68

View File

@@ -525,6 +525,20 @@
- "reboot_seconds={{ _reboot_seconds | default(0) }}" - "reboot_seconds={{ _reboot_seconds | default(0) }}"
- "reboot_minutes={{ _reboot_minutes | default(0) }}" - "reboot_minutes={{ _reboot_minutes | default(0) }}"
- name: Build human-readable reboot phrase
delegate_to: localhost
ansible.builtin.set_fact:
_reboot_phrase: >-
{% if not (_reboot_requested | default(false)) -%}
reboot not requested
{%- elif (_reboot_seconds | int) <= 20 -%}
rebooting now
{%- elif (_reboot_seconds | int) >= 3600 -%}
reboot scheduled in {{ ((_reboot_seconds | int) // 3600) | int }}h
{%- else -%}
reboot scheduled in {{ (_reboot_minutes | int) }}m
{%- endif %}
# ---------------------------- Journal: indoor start (we can proceed) ---------------------------- # ---------------------------- Journal: indoor start (we can proceed) ----------------------------
- name: Build control queue payload for 'indoor start' journal - name: Build control queue payload for 'indoor start' journal
ansible.builtin.set_fact: ansible.builtin.set_fact:
@@ -533,9 +547,9 @@
task_name: "journal_add" task_name: "journal_add"
task_result: >- task_result: >-
Indoor: Dev2 is reachable, starting update. Indoor: Dev2 is reachable, starting update.
image={{ image_filename }}, md5={{ image_md5 }}, image={{ image_filename }},
firmux={{ (dev2_firmux.stdout | default('unknown')) | trim }}, current firmware={{ (dev2_firmux.stdout | default('unknown')) | trim }},
reboot={{ 'in ' ~ (_reboot_seconds | int) ~ ' seconds' if (_reboot_requested | default(false)) else 'not requested' }} {{ _reboot_phrase }}
when: dev2_passfile_used != "NONE" when: dev2_passfile_used != "NONE"
delegate_to: localhost delegate_to: localhost
@@ -1053,11 +1067,7 @@
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: >-
Indoor: Dev2 prepared for update, scheduling reboot {{ Indoor: Dev2 prepared for update, {{ _reboot_phrase }}.
('in ' ~ (_reboot_seconds | int) ~ ' seconds') if (_reboot_requested and (_reboot_minutes | int) == 0)
else ('in ' ~ (_reboot_minutes | int) ~ ' minutes') if (_reboot_requested and (_reboot_minutes | int) > 0)
else 'not requested'
}}.
write_done={{ _write_success }}, write_done={{ _write_success }},
active_before={{ (dev2_active_before.stdout | default('NA')) | trim }}, active_before={{ (dev2_active_before.stdout | default('NA')) | trim }},
active_after={{ (dev2_active_after.stdout | default('NA')) | trim }} active_after={{ (dev2_active_after.stdout | default('NA')) | trim }}