feat(system_baseline): reboot one host at a time and bound a hung apt-daily.service
Build / build (pull_request) Successful in 16s
Lint / lint (pull_request) Successful in 1m0s
Molecule / molecule (pull_request) Successful in 2m2s

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:
Dragonish committed 2026-11-23 21:01:40 +00:00
1 parent 8da65bd08e
commit 7092d68822
14 files changed
+239 -3

No files matched your search

+34 -1
View File
@@ -6,7 +6,7 @@ argument_specs:
- >-
Validates C(system_baseline_system_type) and, when C(system_baseline_tmux_autostart) is true, the tmux session name and
windows, then runs the update (unless C(system_baseline_update) is false), packages, unattended-upgrades, locale, timezone,
journald, sysctl, tmpfs, tmux and reboot task files, in that order.
journald, apt-daily timeout (when set), sysctl, tmpfs, tmux and reboot task files, in that order.
- Needs gathered facts, because the reboot check reads C(ansible_os_family).
- >-
The resolved inputs C(system_baseline_profile), C(system_baseline_essential_packages),
@@ -106,6 +106,29 @@ argument_specs:
default: true
description:
- Reboot when C(/var/run/reboot-required) exists after the run.
system_baseline_reboot_throttle:
type: int
default: 0
description:
- >-
How many hosts of a play reboot at the same time: the C(throttle) of the reboot task. 0 is no limit, as before; 1 reboots one host
at a time, for a group whose members must not be down together. A negative or non-integer value stops the run.
system_baseline_reboot_post_delay:
type: int
default: 0
description:
- >-
Seconds to wait after a rebooted host answers again, before the next host reboots (with a throttle) or the play goes on, so a
service on it can settle. 0 adds no wait, as before. A negative or non-integer value stops the run.
system_baseline_apt_daily_timeout:
type: str
default: ""
description:
- >-
Systemd time span (for example C(1h)) written as C(TimeoutStartSec) of C(apt-daily.service) in
C(/etc/systemd/system/apt-daily.service.d/10-timeout.conf), so a hung apt run is stopped. Empty leaves the host alone; clearing
the value later does not remove a file already written. A value of C(0) means no timeout to systemd.
C(apt-daily-upgrade.service) is not changed. Tag C(apt-daily-timeout).
system_baseline_unattended_upgrade_package_blacklist:
type: list
elements: str
@@ -157,3 +180,13 @@ argument_specs:
default: true
description:
- Reboot when a reboot is required.
system_baseline_reboot_throttle:
type: int
default: 0
description:
- Hosts that reboot at the same time (the C(throttle) of the reboot task); 0 is no limit. Checked before anything runs.
system_baseline_reboot_post_delay:
type: int
default: 0
description:
- Seconds to wait after a rebooted host answers again; 0 adds no wait. Checked before anything runs.