From b5f3a70c68542aa815fcbcefac5e62d218889341 Mon Sep 17 00:00:00 2001 From: pavel Date: Thu, 23 Oct 2025 12:36:08 +0300 Subject: [PATCH] 1236 --- files/ansible-playbooks/update-indoor.yml | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/files/ansible-playbooks/update-indoor.yml b/files/ansible-playbooks/update-indoor.yml index 67c2bc4..95c7a5d 100644 --- a/files/ansible-playbooks/update-indoor.yml +++ b/files/ansible-playbooks/update-indoor.yml @@ -525,6 +525,20 @@ - "reboot_seconds={{ _reboot_seconds | 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) ---------------------------- - name: Build control queue payload for 'indoor start' journal ansible.builtin.set_fact: @@ -533,9 +547,9 @@ task_name: "journal_add" task_result: >- Indoor: Dev2 is reachable, starting update. - image={{ image_filename }}, md5={{ image_md5 }}, - firmux={{ (dev2_firmux.stdout | default('unknown')) | trim }}, - reboot={{ 'in ' ~ (_reboot_seconds | int) ~ ' seconds' if (_reboot_requested | default(false)) else 'not requested' }} + image={{ image_filename }}, + current firmware={{ (dev2_firmux.stdout | default('unknown')) | trim }}, + {{ _reboot_phrase }} when: dev2_passfile_used != "NONE" delegate_to: localhost @@ -1053,11 +1067,7 @@ inscope_device: "{{ ansible_hostname | default(inventory_hostname) }}" task_name: "journal_add" task_result: >- - Indoor: Dev2 prepared for update, scheduling reboot {{ - ('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' - }}. + Indoor: Dev2 prepared for update, {{ _reboot_phrase }}. write_done={{ _write_success }}, active_before={{ (dev2_active_before.stdout | default('NA')) | trim }}, active_after={{ (dev2_active_after.stdout | default('NA')) | trim }}