tasks/reboot.yml runs ansible.builtin.reboot with a fixed reboot_timeout: 900 and no limit on how many hosts reboot at once. In a play over several hosts that all need a reboot (for example after a kernel update), they all reboot in the same moment. For hosts that depend on each other (a pair of DNS resolvers, the nodes of a cluster, a storage host and its clients) that means a full outage that the caller can not avoid from outside: throttle is a keyword of the task that does the reboot, so a play that includes the role can not set it for that one task, and serial on the whole play also serialises every other task of the role. The reboot module also returns as soon as the host answers SSH, so the next host may go down before the containers or services of the first one are back.
Out of scope: when a reboot is needed (system_baseline_reboot_if_required and /var/run/reboot-required stay as they are), and the reboot entry point's name and fact.
Proposal
Two new inputs, with defaults that keep today's behaviour exactly:
system_baseline_reboot_throttle (int, default 0): passed to throttle: of the reboot task. 0 means no limit, as in Ansible. 1 reboots one host at a time; the next host starts when the first one is back.
system_baseline_reboot_post_delay (int seconds, default 0): passed to the module's post_reboot_delay, a wait after the host answers and before the task ends (and so before the next host reboots).
Both are read by the main flow and by tasks_from: reboot, so the supported entry point follows them. argument_specs: type: int, a minimum of 0 enforced in tasks/validate.yml (the entry point does not run it, so the reboot file would need the same check, as the shared-assert pattern of the other files). README (Entry points and Role variables), a minor_changes fragment.
Acceptance criteria
With neither input set, tasks/reboot.yml passes throttle: 0 and post_reboot_delay: 0 (no change from today); a converge in the existing scenario stays idempotent and the reboot task is still skipped when no reboot is required.
system_baseline_reboot_throttle: -1 and a non-integer ("one") are refused with a message that names the variable, in the main flow and in tasks_from: reboot (a refusal case in converge.yml for each).
argument_specs.yml and the README variable table list both inputs with their defaults; ansible-test sanity, ansible-lint and yamllint are clean; a minor_changes fragment is added.
The behaviour itself (hosts reboot one by one) is stated as untested in the PR if no check can show it, see below.
Not verified
Molecule cannot reboot its container, so nothing in CI can show that throttle: 1 serialises two hosts or that the delay is waited. The criteria above check only the defaults and the validation. My own role sets the same two things (throttle: 1, post_reboot_delay: 45) for its reboot task; I have not run this role, and I have not measured the serialisation separately.
Whether throttle accepts a templated value in every ansible-core release you support: I use a literal in my own role. If it does not, the task would need when-split variants.
Whether you would rather have serial-style control at the play level (documented in the README) than new inputs.
Questions for the maintainer
Are two inputs the right shape, or one (system_baseline_reboot_throttle) with the delay left out?
Should the reboot entry point read them, or only the main flow?
Assisted-by: Claude Code
## Problem
`tasks/reboot.yml` runs `ansible.builtin.reboot` with a fixed `reboot_timeout: 900` and no limit on how many hosts reboot at once. In a play over several hosts that all need a reboot (for example after a kernel update), they all reboot in the same moment. For hosts that depend on each other (a pair of DNS resolvers, the nodes of a cluster, a storage host and its clients) that means a full outage that the caller can not avoid from outside: `throttle` is a keyword of the task that does the reboot, so a play that includes the role can not set it for that one task, and `serial` on the whole play also serialises every other task of the role. The reboot module also returns as soon as the host answers SSH, so the next host may go down before the containers or services of the first one are back.
Out of scope: when a reboot is needed (`system_baseline_reboot_if_required` and `/var/run/reboot-required` stay as they are), and the `reboot` entry point's name and fact.
## Proposal
Two new inputs, with defaults that keep today's behaviour exactly:
- `system_baseline_reboot_throttle` (int, default `0`): passed to `throttle:` of the reboot task. `0` means no limit, as in Ansible. `1` reboots one host at a time; the next host starts when the first one is back.
- `system_baseline_reboot_post_delay` (int seconds, default `0`): passed to the module's `post_reboot_delay`, a wait after the host answers and before the task ends (and so before the next host reboots).
Both are read by the main flow and by `tasks_from: reboot`, so the supported entry point follows them. `argument_specs`: `type: int`, a minimum of `0` enforced in `tasks/validate.yml` (the entry point does not run it, so the reboot file would need the same check, as the shared-assert pattern of the other files). README (Entry points and Role variables), a `minor_changes` fragment.
## Acceptance criteria
- [ ] With neither input set, `tasks/reboot.yml` passes `throttle: 0` and `post_reboot_delay: 0` (no change from today); a converge in the existing scenario stays idempotent and the reboot task is still skipped when no reboot is required.
- [ ] `system_baseline_reboot_throttle: -1` and a non-integer (`"one"`) are refused with a message that names the variable, in the main flow and in `tasks_from: reboot` (a refusal case in `converge.yml` for each).
- [ ] `argument_specs.yml` and the README variable table list both inputs with their defaults; `ansible-test sanity`, ansible-lint and yamllint are clean; a `minor_changes` fragment is added.
- [ ] The behaviour itself (hosts reboot one by one) is stated as untested in the PR if no check can show it, see below.
## Not verified
- Molecule cannot reboot its container, so nothing in CI can show that `throttle: 1` serialises two hosts or that the delay is waited. The criteria above check only the defaults and the validation. My own role sets the same two things (`throttle: 1`, `post_reboot_delay: 45`) for its reboot task; I have not run this role, and I have not measured the serialisation separately.
- Whether `throttle` accepts a templated value in every ansible-core release you support: I use a literal in my own role. If it does not, the task would need `when`-split variants.
- Whether you would rather have `serial`-style control at the play level (documented in the README) than new inputs.
## Questions for the maintainer
- Are two inputs the right shape, or one (`system_baseline_reboot_throttle`) with the delay left out?
- Should the `reboot` entry point read them, or only the main flow?
Assisted-by: Claude Code
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
tasks/reboot.ymlrunsansible.builtin.rebootwith a fixedreboot_timeout: 900and no limit on how many hosts reboot at once. In a play over several hosts that all need a reboot (for example after a kernel update), they all reboot in the same moment. For hosts that depend on each other (a pair of DNS resolvers, the nodes of a cluster, a storage host and its clients) that means a full outage that the caller can not avoid from outside:throttleis a keyword of the task that does the reboot, so a play that includes the role can not set it for that one task, andserialon the whole play also serialises every other task of the role. The reboot module also returns as soon as the host answers SSH, so the next host may go down before the containers or services of the first one are back.Out of scope: when a reboot is needed (
system_baseline_reboot_if_requiredand/var/run/reboot-requiredstay as they are), and therebootentry point's name and fact.Proposal
Two new inputs, with defaults that keep today's behaviour exactly:
system_baseline_reboot_throttle(int, default0): passed tothrottle:of the reboot task.0means no limit, as in Ansible.1reboots one host at a time; the next host starts when the first one is back.system_baseline_reboot_post_delay(int seconds, default0): passed to the module'spost_reboot_delay, a wait after the host answers and before the task ends (and so before the next host reboots).Both are read by the main flow and by
tasks_from: reboot, so the supported entry point follows them.argument_specs:type: int, a minimum of0enforced intasks/validate.yml(the entry point does not run it, so the reboot file would need the same check, as the shared-assert pattern of the other files). README (Entry points and Role variables), aminor_changesfragment.Acceptance criteria
tasks/reboot.ymlpassesthrottle: 0andpost_reboot_delay: 0(no change from today); a converge in the existing scenario stays idempotent and the reboot task is still skipped when no reboot is required.system_baseline_reboot_throttle: -1and a non-integer ("one") are refused with a message that names the variable, in the main flow and intasks_from: reboot(a refusal case inconverge.ymlfor each).argument_specs.ymland the README variable table list both inputs with their defaults;ansible-test sanity, ansible-lint and yamllint are clean; aminor_changesfragment is added.Not verified
throttle: 1serialises two hosts or that the delay is waited. The criteria above check only the defaults and the validation. My own role sets the same two things (throttle: 1,post_reboot_delay: 45) for its reboot task; I have not run this role, and I have not measured the serialisation separately.throttleaccepts a templated value in every ansible-core release you support: I use a literal in my own role. If it does not, the task would needwhen-split variants.serial-style control at the play level (documented in the README) than new inputs.Questions for the maintainer
system_baseline_reboot_throttle) with the delay left out?rebootentry point read them, or only the main flow?Assisted-by: Claude Code