Restart all targeted services on start and restart runs again

Conditional restart is enabled whenever no setup-* tag is selected, so it
also applies to runs with only start or restart tags. These runs skip
the install tasks that set each role's *_restart_necessary, so every
service whose value is false is only started. When the rule was added,
only Traefik tracked its changes this way; now most roles do, so
`just start-all` and `just start-group` restart almost nothing, contrary
to docs/just.md.

Enable conditional restart only when an install-* tag is selected and no
setup-* tag. install-* runs keep conditional restart and setup-* runs are
unchanged; runs with only start or restart tags restart their targeted
services unconditionally again. Show the restart behavior of each
standard recipe in docs/just.md and announce the change in CHANGELOG.md.
This commit is contained in:
QEDeD
2026-10-19 09:10:11 +03:00
committed by Slavi Pantaleev
parent ce24219389
commit d69bf26d67
3 changed files with 25 additions and 5 deletions
+10 -4
View File
@@ -46,10 +46,16 @@ Such kind of difference sometimes matters. For example, when you install a Matri
## Conditional service restart
When running `install-all` or `install-service` (whether via `just` or raw `ansible-playbook`), only services whose configuration or container image actually changed during the playbook run will be restarted. Unchanged services are left running (or get started if they were stopped). This reduces unnecessary downtime.
With conditional restart, a service whose role tracks its changes is restarted only when its configuration or container image changed during the run. An unchanged service is left running, or started if it was stopped. Whether conditional restart applies depends on the playbook tags. The standard `just` recipes add these tags:
When running with `setup-*` tags (e.g. `setup-all`, `setup-synapse`), all services are unconditionally restarted regardless of whether changes were detected. This is appropriate for setup's thorough "full setup" semantics.
| Command | Tags added by the recipe | Restart behavior |
|--------------------------------|-------------------------------------------------|----------------------------------------------|
| `just install-all` | `install-all,ensure-matrix-users-created,start` | Conditional |
| `just install-service SERVICE` | `install-SERVICE,start-group` | Conditional, within the service's group |
| `just setup-all` | `setup-all,ensure-matrix-users-created,start` | Unconditional: all targeted services restart |
| `just start-all` | `start-all` | Unconditional: all services restart |
| `just start-group GROUP` | `start-group` | Unconditional, within the group |
`start-all` and `start-group` always restart all targeted services, since no installation tasks run during these commands.
For raw `ansible-playbook` or `just run-tags` runs, conditional restart applies only when the selected tags include an `install-*` tag and no `setup-*` tag. Any other run with a start or restart tag restarts its targeted services unconditionally.
This behavior is automatically determined based on the playbook tags in use. It can be overridden with the `devture_systemd_service_manager_conditional_restart_enabled` variable. For example, to force unconditional restarts during installation: `just install-all --extra-vars='devture_systemd_service_manager_conditional_restart_enabled=false'`
This behavior can be overridden with the `devture_systemd_service_manager_conditional_restart_enabled` variable. For example, to force unconditional restarts during installation: `just install-all --extra-vars='devture_systemd_service_manager_conditional_restart_enabled=false'`