2305
This commit is contained in:
@@ -487,10 +487,12 @@
|
|||||||
- name: Normalize rebootin (strict hours → seconds/minutes)
|
- name: Normalize rebootin (strict hours → seconds/minutes)
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
reboot_hours: "{{ rebootin | int }}"
|
reboot_hours: "{{ (rebootin | default('') | string) | trim | int }}"
|
||||||
|
reboot_seconds: "{{ ((rebootin | default('') | string) | trim | int) * 3600 }}"
|
||||||
|
reboot_minutes: "{{ ((rebootin | default('') | string) | trim | int) * 60 }}"
|
||||||
reboot_requested: true
|
reboot_requested: true
|
||||||
reboot_seconds: "{{ (rebootin | int) * 3600 + 20 }}"
|
|
||||||
reboot_minutes: "{{ (rebootin | int) * 60 }}"
|
|
||||||
|
|
||||||
- name: Debug reboot normalization detail
|
- name: Debug reboot normalization detail
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
@@ -511,19 +513,13 @@
|
|||||||
# Compute reboot flags and *final* seconds.
|
# Compute reboot flags and *final* seconds.
|
||||||
# Rule: now/empty/0 -> 20s grace; hours>0 -> hours*3600 (no extra 20s).
|
# Rule: now/empty/0 -> 20s grace; hours>0 -> hours*3600 (no extra 20s).
|
||||||
|
|
||||||
- name: Compute reboot flags requested and seconds with 20s grace
|
- name: Compute reboot delay (add 20s grace)
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
_reboot_requested: "{{ _reboot_is_now or _reboot_is_int }}"
|
reboot_delay_seconds: "{{ reboot_seconds + 20 }}"
|
||||||
# Rule:
|
reboot_delay_minutes: "{{ ((reboot_seconds + 20) / 60) | int }}"
|
||||||
# - now/empty OR hours <= 0 -> 20s
|
|
||||||
# - hours > 0 -> hours * 3600 (no extra 20s)
|
|
||||||
_reboot_seconds: >-
|
|
||||||
{{
|
|
||||||
20 if _reboot_is_now
|
|
||||||
else (20 if ((_reboot_is_int | bool) and ((_reboot_hours | int) <= 0))
|
|
||||||
else ((_reboot_hours | int) * 3600))
|
|
||||||
}}
|
|
||||||
|
|
||||||
# Derive minutes from seconds
|
# Derive minutes from seconds
|
||||||
- name: Derive reboot minutes from seconds
|
- name: Derive reboot minutes from seconds
|
||||||
@@ -1029,7 +1025,7 @@
|
|||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
au_attempt: 1
|
au_attempt: 1
|
||||||
au_max_attempts: 3
|
au_max_attempts: 3
|
||||||
au_delay_sec: "{{ (_reboot_seconds | int) + 360 }}"
|
au_delay_sec: "{{ reboot_delay_seconds + 360 }}"
|
||||||
when: not (_blocked | default(false)) and (_write_success | bool)
|
when: not (_blocked | default(false)) and (_write_success | bool)
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
@@ -1130,9 +1126,9 @@
|
|||||||
- "write_done={{ (dev2_up_write.stdout | default('')) is search('update is complete') if (dev2_up_write is defined) else 'NA' }}"
|
- "write_done={{ (dev2_up_write.stdout | default('')) is search('update is complete') if (dev2_up_write is defined) else 'NA' }}"
|
||||||
- "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 }}"
|
||||||
- "reboot_requested={{ _reboot_requested | default(false) }}"
|
- "reboot_requested={{ reboot_requested | default(false) }}"
|
||||||
- "reboot_delay_seconds={{ _reboot_seconds | int if (_reboot_requested | default(false)) else 'NA' }}"
|
- "reboot_delay_seconds={{ reboot_delay_seconds if (reboot_requested | default(false)) else 'NA' }}"
|
||||||
- "reboot_delay_minutes={{ _reboot_minutes | int if (_reboot_requested | default(false)) else 'NA' }}"
|
- "reboot_delay_minutes={{ reboot_delay_minutes if (reboot_requested | default(false)) else 'NA' }}"
|
||||||
- "reboot_applied={{ (dev2_reboot_sched is defined and dev2_reboot_sched.rc is defined and dev2_reboot_sched.rc == 0) | default(false) }}"
|
- "reboot_applied={{ (dev2_reboot_sched is defined and dev2_reboot_sched.rc is defined and dev2_reboot_sched.rc == 0) | default(false) }}"
|
||||||
- "prep_blocked={{ _prep_blocked | default(false) }}"
|
- "prep_blocked={{ _prep_blocked | default(false) }}"
|
||||||
- "blocked={{ _blocked | default(false) }}"
|
- "blocked={{ _blocked | default(false) }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user