diff --git a/CHANGELOG.md b/CHANGELOG.md index b02273a88..85433f5ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# 2026-10-18 + +## `just start-all` and `just start-group` restart all targeted services again + +Since [conditional service restart](#conditional-service-restart-for-install--commands) was introduced, it also applied to runs with only start or restart tags. As more roles began tracking their own changes, these commands stopped restarting most services and only started those that were stopped, contrary to the [documentation](./docs/just.md#conditional-service-restart). + +Conditional restart now applies only when an `install-*` tag is selected and no `setup-*` tag. `just install-all` and `just install-service` are unchanged. `just start-all`, `just start-group` and other runs with only start or restart tags restart all their targeted services again, so they briefly interrupt running services. To keep the previous behavior for such a run, add `--extra-vars='devture_systemd_service_manager_conditional_restart_enabled=true'`. + # 2026-10-10 ## Optional system cleanup, including safe removal of superseded Docker images diff --git a/docs/just.md b/docs/just.md index 8b714a837..f47ecdb05 100644 --- a/docs/just.md +++ b/docs/just.md @@ -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'` diff --git a/group_vars/matrix_servers b/group_vars/matrix_servers index 5ece91a09..257135280 100755 --- a/group_vars/matrix_servers +++ b/group_vars/matrix_servers @@ -381,10 +381,16 @@ matrix_addons_homeserver_systemd_services_list: | # We override it here to automatically match the intent of the playbook tags being used: # - install-* tags (regular upgrades): conditional restart ON — only changed services restart, reducing downtime # - setup-* tags (full setup/reconfiguration): conditional restart OFF — all services restart unconditionally +# - standalone start/restart tags: conditional restart OFF — selected services restart unconditionally # # This ensures consistent behavior whether users invoke the playbook via `just` shortcuts # or raw `ansible-playbook --tags=...` commands. -devture_systemd_service_manager_conditional_restart_enabled: "{{ ansible_run_tags | select('match', 'setup-') | list | length == 0 }}" +devture_systemd_service_manager_conditional_restart_enabled: >- + {{ + (ansible_run_tags | select('match', 'install-') | list | length > 0) + and + (ansible_run_tags | select('match', 'setup-') | list | length == 0) + }} devture_systemd_service_manager_services_list_auto: | {{