feat(system_baseline): reboot one host at a time and bound a hung apt-daily.service
Add system_baseline_reboot_throttle and system_baseline_reboot_post_delay, passed to the throttle and post_reboot_delay of the reboot task, read by the main flow and by tasks_from: reboot, both defaulting to 0 (today's behaviour) and validated in both. Add system_baseline_apt_daily_timeout: when set, write a TimeoutStartSec drop-in for apt-daily.service and reload systemd. Empty by default, which leaves the host alone. Closes #336 Closes #337 Assisted-by: Claude Code
This commit is contained in:
1 parent
8da65bd08e
commit
7092d68822
14 files changed
+239
-3
No files matched your search
@@ -0,0 +1,11 @@
|
||||
---
|
||||
# One refusal per input: the main flow and the reboot entry point must both stop on validation, with a message that names the variable.
|
||||
- name: Run the main flow and the entry point with a bad reboot input
|
||||
ansible.builtin.include_tasks: refuse_reboot_one.yml
|
||||
vars:
|
||||
system_baseline_refused_entry: "{{ entry }}"
|
||||
loop:
|
||||
- main
|
||||
- reboot
|
||||
loop_control:
|
||||
loop_var: entry
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
- name: Run the role with a bad reboot input
|
||||
block:
|
||||
- name: Include system_baseline
|
||||
ansible.builtin.include_role:
|
||||
name: mortis.kamino.system_baseline
|
||||
tasks_from: "{{ system_baseline_refused_entry }}"
|
||||
vars:
|
||||
system_baseline_system_type: ubuntu_lxc
|
||||
system_baseline_reboot_throttle: "{{ system_baseline_refused_reboot.system_baseline_reboot_throttle | default(0) }}"
|
||||
system_baseline_reboot_post_delay: "{{ system_baseline_refused_reboot.system_baseline_reboot_post_delay | default(0) }}"
|
||||
- name: Unreachable when validation works
|
||||
ansible.builtin.fail:
|
||||
msg: system_baseline ran with an invalid reboot input
|
||||
rescue:
|
||||
- name: The validation stopped the play
|
||||
ansible.builtin.assert:
|
||||
that: "'system_baseline_reboot_throttle (' in ansible_failed_result.msg | default('')"
|
||||
quiet: true
|
||||
Reference in new issue
Block a user