feat(system_baseline): reboot one host at a time and bound a hung apt-daily.service #339

Merged
Dragonish merged 1 commits from feat/336-337-reboot-throttle-apt-daily into main 2026-11-23 21:10:24 +00:00
Collaborator

What and why

Two small system_baseline inputs, requested in #336 and #337.

  • system_baseline_reboot_throttle and system_baseline_reboot_post_delay (whole numbers, default 0) are passed to the throttle and post_reboot_delay of the reboot task, so a caller can reboot one host at a time and wait before the next. The main flow and tasks_from: reboot read them. A negative or non-integer value stops the run before a host reboots, in both (a shared validate_reboot.yml, because the entry point does not run validate.yml).
  • system_baseline_apt_daily_timeout (string, default empty) writes /etc/systemd/system/apt-daily.service.d/10-timeout.conf with TimeoutStartSec=<value> and reloads systemd when it changed. Empty leaves the host alone. Only apt-daily.service changes. Tag apt-daily-timeout. The value is checked to be one line starting with a digit (or infinity), so it cannot add a second directive to the unit file.

The defaults keep today's behaviour. Also changed: argument_specs, the README (variable table, entry point, two sections), one minor_changes fragment.

Closes #336
Closes #337

Verified

  • yamllint and ansible-lint (production profile) pass; the commit hooks pass.
  • Locally on ansible-core 2.22: a throttle of -1 and a timeout with a line break are refused with a message that names the variable, in the main flow and in the reboot entry point; valid values, including a templated throttle:, pass.
  • Molecule (CI): the converge sets 1h; verify reads the drop-in and checks that systemd reports LoadState=loaded and TimeoutStartUSec=1h; the refusals above are asserted.

Not verified

  • A real reboot with a throttle: CI cannot reboot its container, and the reboot task is tagged update, which the scenario skips. Only the validation is tested.

  • throttle templating on every supported ansible-core release; I ran 2.22 only.

  • apt-daily.service is assumed to exist in the Molecule image; if it does not, the LoadState=loaded check fails and needs a stub unit.

  • A value systemd cannot parse (such as 1xyz) passes the role's check; systemd ignores it and logs it. 0 is accepted and means no timeout (documented).

  • No third-party code or copied text is included.

Assisted-by: Claude Code

## What and why Two small `system_baseline` inputs, requested in #336 and #337. - `system_baseline_reboot_throttle` and `system_baseline_reboot_post_delay` (whole numbers, default `0`) are passed to the `throttle` and `post_reboot_delay` of the reboot task, so a caller can reboot one host at a time and wait before the next. The main flow and `tasks_from: reboot` read them. A negative or non-integer value stops the run before a host reboots, in both (a shared `validate_reboot.yml`, because the entry point does not run `validate.yml`). - `system_baseline_apt_daily_timeout` (string, default empty) writes `/etc/systemd/system/apt-daily.service.d/10-timeout.conf` with `TimeoutStartSec=<value>` and reloads systemd when it changed. Empty leaves the host alone. Only `apt-daily.service` changes. Tag `apt-daily-timeout`. The value is checked to be one line starting with a digit (or `infinity`), so it cannot add a second directive to the unit file. The defaults keep today's behaviour. Also changed: `argument_specs`, the README (variable table, entry point, two sections), one `minor_changes` fragment. Closes #336 Closes #337 ## Verified - `yamllint` and `ansible-lint` (production profile) pass; the commit hooks pass. - Locally on ansible-core 2.22: a throttle of `-1` and a timeout with a line break are refused with a message that names the variable, in the main flow and in the reboot entry point; valid values, including a templated `throttle:`, pass. - Molecule (CI): the converge sets `1h`; verify reads the drop-in and checks that systemd reports `LoadState=loaded` and `TimeoutStartUSec=1h`; the refusals above are asserted. ## Not verified - A real reboot with a throttle: CI cannot reboot its container, and the reboot task is tagged `update`, which the scenario skips. Only the validation is tested. - `throttle` templating on every supported ansible-core release; I ran 2.22 only. - `apt-daily.service` is assumed to exist in the Molecule image; if it does not, the `LoadState=loaded` check fails and needs a stub unit. - A value systemd cannot parse (such as `1xyz`) passes the role's check; systemd ignores it and logs it. `0` is accepted and means no timeout (documented). - [ ] No third-party code or copied text is included. Assisted-by: Claude Code
Dragonish added 1 commit 2026-11-23 21:07:02 +00:00
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
7092d68822
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
Dragonish scheduled this pull request to auto merge when all checks succeed 2026-11-23 21:08:52 +00:00
Dragonish merged commit c5077ce685 into main 2026-11-23 21:10:24 +00:00
Dragonish deleted branch feat/336-337-reboot-throttle-apt-daily 2026-11-23 21:10:25 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mortis/Kamino#339