3
0
mirror of https://github.com/spantaleev/matrix-docker-ansible-deploy.git synced 2026-05-15 19:55:06 +00:00
Commit Graph

99 Commits

Author SHA1 Message Date
Catalan Lover
4af35777b3 Update Draupnir from 3.0.0 to 3.1.0 and introduce Zero Touch Deployment to mdad. (#5205) 2026-05-07 16:59:53 +03:00
Catalan Lover
75f097e55c Modernise Draupnir Role ansible modules and update restart logic (#5187) 2026-05-04 16:15:18 +03:00
Slavi Pantaleev
d830c88275 Fix Draupnir conditional restart not triggering on force-pulled image updates
matrix-bot-draupnir and matrix-appservice-draupnir-for-all share the same
upstream container image. When both are enabled and force-pull is on
(e.g. when pinning to a rolling tag like `latest` or `main`), the second
role to run during a single playbook invocation sees the image as already
up-to-date locally because the first role just pulled it. The
community.docker.docker_image module reports `changed: false` in that
case, so the second role's restart_necessary stays false and the
conditional restart logic skips it. Result: the first service picks up
the new image on restart, while the second keeps running the old one.

For other versions which don't get force-pulled (other than `latest`),
systemd service files also get updated by the playbook and these updates
done by each role properly flip the "requires restarting" variable
regardless of pulling. So it's just force-pulling that causes the problem.

Treating force-pull itself as a restart trigger sidesteps the lossy
"did this specific pull task fetch new bytes" heuristic. The downside
is that both Draupnir services now restart on every run when force-pull
is enabled, even when the upstream image has not moved. That is a small
amount of waste compared to silently running an outdated container.

Localized to these two roles via a comment that documents the
constraint, rather than applied playbook-wide, since this is the only
known image-sharing pair and other roles do not need the extra
restarts.

Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/5186

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 00:16:27 +03:00
Catalan Lover
09bf24ade8 Update Draupnir from v2.9.0 to v3.0.0 (#5110) 2026-04-02 22:30:13 +03:00
Catalan Lover
54c0b56200 Prepare Draupnir Roles for move to GHCR. 2026-03-19 19:07:19 +02:00
Slavi Pantaleev
893e90a65f Rename matrix-bot-draupnir _docker_ vars to _container_
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 08:16:07 +02:00
QEDeD
f0f496b6ba Quote YAML mode values to satisfy octal lint rules 2026-02-16 13:19:10 +02:00
Slavi Pantaleev
16010ff8c7 Add conditional restart support to client, bot, and bridge roles
For each of the 34 roles (3 clients, 9 bots, 22 bridges), this commit:
- Adds `_restart_necessary: false` default variable
- Adds `register:` directives to config/image/systemd tasks
- Computes `_restart_necessary` via set_fact (OR of all .changed results)
- Wires `(_restart_necessary | bool)` in group_vars/matrix_servers

This allows the systemd service manager to skip unnecessary restarts
when running install-* tags and nothing actually changed.

Service roles and complex multi-service roles will follow separately.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 15:33:54 +02:00
Slavi Pantaleev
6da1223500 Rename _requires_restart to _migration_requires_restart across all custom roles
These variables track whether a database migration necessitates a service
restart. The new name avoids confusion with the conditional restart
feature introduced in af193043/9accc848/4a8df138, where
devture_systemd_service_manager handles restarting services whose
configuration or image changed. The old _requires_restart name was
ambiguous — it could be mistaken for the systemd_service_manager
mechanism — so _migration_requires_restart makes the purpose explicit.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 14:46:06 +02:00
Slavi Pantaleev
9d6c8eabcb Fix swapped Requires=/Wants= directives in Draupnir and Mjolnir systemd service templates
Commit 593b3157b ("Fix systemd service Wants for mjolnir and draupnir")
accidentally swapped the variable loops: `systemd_wanted_services_list`
ended up generating `Requires=`/`After=` directives and
`systemd_required_services_list` ended up generating `Wants=` directives —
the opposite of what the variable names mean and how every other
bot/bridge service template in the playbook works.

This caused these bots to only `Wants=` (not `Requires=`/`After=`) their
dependencies like matrix-traefik.service, so systemd didn't guarantee
ordering. During all-at-once restarts, the bots would start before traefik
was ready, fail with DNS resolution errors, and crash.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-11 18:54:41 +02:00
renovate[bot]
16bec7bfbb chore(deps): update gnuxie/draupnir docker tag to v2.9.0 2025-12-18 16:48:46 +02:00
Slavi Pantaleev
ebdb2cc827 Use a proper (bool) value for the matrix_bot_draupnir_login_native variable
Otherwise Ansible casts the "" string to a bool.
This works, but it's deprecated and a bad idea anyway.
2025-11-26 13:20:20 +02:00
Slavi Pantaleev
430f350733 Stop using deprecated vars variable 2025-11-26 11:35:09 +02:00
renovate[bot]
2eadddcde9 chore(deps): update gnuxie/draupnir docker tag to v2.8.0 2025-11-23 15:57:05 +02:00
renovate[bot]
7caa583743 chore(deps): update gnuxie/draupnir docker tag to v2.7.1 2025-10-13 16:35:03 +00:00
renovate[bot]
4145b811a3 chore(deps): update gnuxie/draupnir docker tag to v2.7.0 2025-10-10 16:06:57 +03:00
renovate[bot]
c4968592d9 Update gnuxie/draupnir Docker tag to v2.6.1 2025-08-14 18:35:47 +00:00
Aine
6658c690cb allow native draupnir (bot) auth using login/password 2025-08-13 07:38:00 +03:00
renovate[bot]
b129ab77cd Update gnuxie/draupnir Docker tag to v2.6.0 2025-08-12 22:45:55 +03:00
renovate[bot]
593fbd74de Update gnuxie/draupnir Docker tag to v2.5.1 2025-08-07 08:38:18 +03:00
Slavi Pantaleev
51ab9ed9ff Adjust lstrip_blocks to use a bool value for compatibility with ansible-core>=2.19.0
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4445
2025-07-26 17:58:12 +03:00
Slavi Pantaleev
a1f6ee4dc9 Improve compatibility with ansible-core>=2.19.0 by not reaching into vars
Fixes https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/4445
2025-07-26 17:50:20 +03:00
renovate[bot]
2d1b1cfdde Update gnuxie/draupnir Docker tag to v2.5.0 2025-07-09 22:42:50 +03:00
Catalan Lover
31a7f4367c Update Draupnir role Synapse-http-antispam config to match upstream. (#4392) 2025-06-28 10:49:37 +03:00
renovate[bot]
93fffee6a4 Update gnuxie/draupnir Docker tag to v2.4.1 2025-06-24 06:09:26 +03:00
renovate[bot]
91817e8335 Update gnuxie/draupnir Docker tag to v2.4.0 2025-06-23 15:09:42 +03:00
Suguru Hirahara
3653f9f89b Run codespell --write-changes
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-06-03 10:36:00 +03:00
Catalan Lover
a2ddbb8169 Update Draupnir config template to v2.3.1 template
Also removes the FIX ME for Polling as well it being broken in the playbook is no longer true.
2025-05-30 13:02:25 +03:00
renovate[bot]
2c9aa1af9c Update gnuxie/draupnir Docker tag to v2.3.1 2025-05-30 00:19:40 +03:00
renovate[bot]
1dc404dc5f Update gnuxie/draupnir Docker tag to v2.3.0 2025-05-29 22:34:47 +03:00
Catalan Lover
4e0f031ebd Fix Synapse-HTTP-Antispam configuration error in Draupnir 2025-05-08 12:39:30 +03:00
Slavi Pantaleev
360ee544a9 Make indentation level in roles/custom/matrix-bot-draupnir/defaults/main.yml consistent 2025-05-08 10:06:17 +03:00
Slavi Pantaleev
465df3a949 Add support for synapse-http-antispam and integrate it with Draupnir
Supersedes https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/4284
2025-05-08 10:03:53 +03:00
Slavi Pantaleev
3ee7deb2d7 Rename variable (matrix_user_groupname -> matrix_group_name) 2025-04-29 10:39:41 +03:00
Slavi Pantaleev
9fc5cdab33 Rename variable (matrix_user_username -> matrix_user_name) 2025-04-29 10:39:41 +03:00
Catalan Lover
85d82eb1e4 Rework Draupnir report interception to accommodate other Web API uses. (#4221) 2025-04-17 22:47:16 +03:00
Slavi Pantaleev
a0573e5855 Fix undefined variable usage in Draupnir config (matrix_bot_draupnir_config_enableMakeRoomAdminCommand -> matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand)
Related to https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/3389
2025-03-15 09:29:16 +02:00
Catalan Lover
cd60cf1199 Internal Admin API and Draupnir Hjack Command Config (#3389)
* Enable Internal Admin API Access separately from Public access.

* Add Config variable for Draupnir Hijack command

And also make the internal admin API be automatically  activated when this capability is used.

* Apply suggestions from code review

Co-authored-by: Slavi Pantaleev <slavi@devture.com>

* Further Refine Internal Admin API

* Add Non Worker Labels for Internal Admin API

* Variable Rename

* Add validation rules for Internal Synapse admin API

* Add Draupnir Admin API required config validation.

* Override `matrix_synapse_reverse_proxy_companion_container_labels_internal_client_synapse_admin_api_traefik_entrypoints` via group vars

* Wire `matrix_bot_draupnir_admin_api_enabled` to `matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand` in Draupnir's `defaults/main.yml`

* Remove unnecessary `matrix_bot_draupnir_admin_api_enabled` override from `group_vars/matrix_servers`

The same value is now (more appropriately) defined in Draupnir's `defaults/main.yml` file anyway.

* Add additional condition (`matrix_bot_draupnir_enabled`) for enabling `matrix_synapse_container_labels_internal_client_synapse_admin_api_enabled`

* Use a separate task for validating `matrix_bot_draupnir_admin_api_enabled` when `matrix_bot_draupnir_config_admin_enableMakeRoomAdminCommand`

The other task deals with checking for null and not-blank and can't handle booleans properly.

---------

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2025-03-15 09:14:55 +02:00
Catalan Lover
6077c7a1d6 Fix bug in marking Pantal and Rust Crypto as mutually exclusive. 2025-03-14 19:28:20 +02:00
Catalan Lover
808d0202c7 Fix Rust Crypto variables being partially missed in Rename 2025-03-14 12:23:25 +02:00
Catalan Lover
166f412783 Modernise Draupnir Configuration Variable Names (#4170)
* Modernise Draupnir Configuration Variable Names

* Move Draupnir deprecation-check task before undefined-variables-check

* Fix trailing spaces in Draupnir's `validate_config.yml`

---------

Co-authored-by: Slavi Pantaleev <slavi@devture.com>
2025-03-13 20:25:30 +02:00
Slavi Pantaleev
bf0918ae58 Merge branch 'master' into patch-2 2025-03-05 08:29:35 +02:00
Suguru Hirahara
c18fc93a22 Update validate_config.yml files: edit the banner message for variables name
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-03-05 13:30:50 +09:00
Suguru Hirahara
e1c03dc7ff Add license information to a role
Signed-off-by: Suguru Hirahara <acioustick@noreply.codeberg.org>
2025-03-05 00:26:05 +09:00
renovate[bot]
88413a08cb Update gnuxie/draupnir Docker tag to v2.2.0 2025-03-03 20:24:16 +00:00
Slavi Pantaleev
c47eca389b Rework all roles to include component_(docker|container)_image_registry_prefix* variables
This:

- brings consistency - no more mixing `_name_prefix` and `_registry_prefix`
- adds extensibility - a future patch will allow reconfiguring all registry prefixes for all roles in the playbook

We still have `_docker_` vs `_container_` inconsistencies.
These may be worked on later.
2025-02-24 11:38:47 +02:00
Slavi Pantaleev
d6bf789710 Remove matrix_container_global_registry_prefix variable
This is done for a few reasons:

- less globals and more indepdendence for each role is better. We rely
  on various externally-hosted roles and they don't rely on this global
  either.

- `matrix_container_global_registry_prefix` could make people think they
  could just override this variable and have all their images pull from
  elsewhere. This is rarely the case, unless you've taken special care
  to mirror all the various components (from their respective
  registries) to your own. In such a case, you probably know what you're
  mirroring and can adjust individual variables.

- nowadays, various components live on different registries.
  With Docker Inc tightening rate limits for Docker Hub, it's even more
  likely that we'll see increased diversity in where images are hosted
2025-02-23 10:15:41 +02:00
Slavi Pantaleev
d12643eb91 Do not use docker stop --time (deprecated in Docker v28 in favor of --timeout or just -t)
`-t` works on both old and new Docker versions, so it's best to use that.
2025-02-22 21:42:18 +02:00
renovate[bot]
1034c06fc7 Update gnuxie/draupnir Docker tag to v2.1.0 2025-02-02 16:54:40 +00:00
renovate[bot]
292b0704cc Update gnuxie/draupnir Docker tag to v2.0.2 2025-01-24 21:29:50 +02:00