mirror of
https://github.com/spantaleev/matrix-docker-ansible-deploy.git
synced 2026-10-22 14:24:17 +00:00
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:
@@ -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
|
||||
|
||||
+10
-4
@@ -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'`
|
||||
|
||||
@@ -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: |
|
||||
{{
|
||||
|
||||
Reference in New Issue
Block a user