From 9bf35d672a2047bf848b288fa72caff64c98b447 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Fri, 3 Jul 2026 00:45:24 +0200 Subject: [PATCH] fix(xwiki): rotate the swarm config name so the final deploy converges In the swarm-DinD test the ansible controller (ansible_connection: docker) cannot read the STACK_HOST-rendered xwiki.properties, so compose_volumes' content hash falls back to the source path and the config name is constant. xwiki deploys twice (bootstrap with the OIDC block off, final with it on after the extension installs), so the config content changes but the name does not, and the final docker stack deploy fails to update the immutable config with 'only updates to Labels are allowed'. Honor an explicit name: on config/secret entries in compose_volumes (volumes already did), and give xwiki's properties config a name that rotates with the OIDC phase, so the final deploy creates a new config instead of updating in place. Backward-compatible: no other role sets name: on a config. make test green. Co-Authored-By: Claude Opus 4.8 (1M context) --- plugins/filter/compose_volumes.py | 6 ++++-- roles/web-app-xwiki/meta/volumes.yml | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/filter/compose_volumes.py b/plugins/filter/compose_volumes.py index a0bb0f2780..4692129a55 100644 --- a/plugins/filter/compose_volumes.py +++ b/plugins/filter/compose_volumes.py @@ -255,7 +255,8 @@ def compose_volumes( if vtype == "config": source = _maybe_render(entry.get("source", ""), render_jinja) configs[semantic_name] = { - "name": _config_secret_name(role_entity, semantic_name, source), + "name": _maybe_render(entry.get("name", ""), render_jinja) + or _config_secret_name(role_entity, semantic_name, source), "file": source, } continue @@ -263,7 +264,8 @@ def compose_volumes( if vtype == "secret": source = _maybe_render(entry.get("source", ""), render_jinja) secrets[semantic_name] = { - "name": _config_secret_name(role_entity, semantic_name, source), + "name": _maybe_render(entry.get("name", ""), render_jinja) + or _config_secret_name(role_entity, semantic_name, source), "file": source, } continue diff --git a/roles/web-app-xwiki/meta/volumes.yml b/roles/web-app-xwiki/meta/volumes.yml index ba9b386f85..433c0bd9de 100644 --- a/roles/web-app-xwiki/meta/volumes.yml +++ b/roles/web-app-xwiki/meta/volumes.yml @@ -8,6 +8,7 @@ data: properties: type: config + name: "xwiki_properties_{{ 'oidc' if xwiki_oidc_enabled_switch | default(false) | bool else 'std' }}" source: "{{ [lookup('container', 'web-app-xwiki', 'directories.config'), 'xwiki.properties'] | path_join }}" mode: "0440" mounts: