Files
computer-playbook/roles/web-app-wordpress/meta/variants.yml
kevinveenbirkenbachandClaude Opus 5 328113e7c3 refactor(ai): declare the litellm consumer contract once
Fourteen roles repeated the same two lines to say they use the gateway: a
`shared` flag gated on group_names, and an `enabled` flag conjoining that gate
with LITELLM_CHAT_MODEL_SERVED. Both are now single-sourced.

`shared` becomes literal true. The flag means the provider is a shared instance
rather than one deployed per consumer, and a central gateway is always that;
the dynamic form only said "shared if deployed", which `enabled` already
decides. The 50 shared pins under `litellm:` leave meta/variants.yml with it.
The tree had already noticed: 20 of those 50 lines carried
`# nocheck: variants-static-override`, two of them with copy-pasted text about
container_backup. This narrows e5de4e085a for one service key rather than
reversing it; every other dynamic flag keeps the group_names form.

`enabled` becomes `{{ LITELLM_USABLE }}`, defined in group_vars/all/16_ai.yml.

That shorthand is only possible because is_explicit_truth learns about it.
The resolver reads a dependency out of the flag TEXT — "in group_names" in
value — so a constant hides the role id and the provider silently leaves the
static closure of every role referencing it. Measured: the old expression
resolves True, `{{ LITELLM_USABLE }}` resolves False. GROUP_GATED_CONSTANTS
names the constants whose own definition carries the gate, and the docstring
states the obligation: a SPOT of this kind that is not listed there drops its
provider without a word.

The wider fix, accepting any Jinja as dynamic, was measured and rejected: 35
other flags carry a Jinja value without the marker (MCP sidecars, javascript
and SSO gates, recaptcha), and they would all enter closures they are not in
today.

A literal shared flag is no longer dynamic, so test_dynamic_flags wants the
`# nocheck: dynamic-flag` its own message documents for legitimate exceptions;
where a marker already existed the rule list is extended rather than a second
comment added.

Behaviour is unchanged where it counts. The closure keeps litellm with the same
app counts (wordpress 26, openwebui 23, hermes 23, mediawiki 22, flowise 23),
unrelated Jinja still resolves False, and the truth table of the new enabled
form matches the old one in all four served/deployed combinations. Three roles
resolve without litellm, and `git show HEAD:` proves that predates this change:
zammad pins enabled false in variant 0 at line 39, nextcloud at line 97.

Six unit tests cover the resolver, including one asserting that every
registered constant is actually defined in group_vars, so an entry cannot
become a dead promise.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 19:23:59 +02:00

104 lines
2.8 KiB
YAML

---
# Matrix-deploy variant overrides for this role.
# verification). Variant 0 keeps the canonical Single-Site flow;
# variant 1 flips the role into Multisite mode against three canonical
# domains so the Multisite Playwright scenarios run against a live
# network. The development deploy wrapper purges the WordPress entities
# between rounds whenever the variant changes, so Single-Site state
# cannot bleed into the Multisite run.
# See docs/contributing/artefact/files/role/variants.md for the file format.
# variant 0: canonical Single-Site deploy.
- services:
container_backup:
enabled: true
css:
enabled: true
shared: true
discourse:
enabled: true
shared: true
dashboard:
enabled: true
shared: true
email:
enabled: true
shared: true
logout:
enabled: true
shared: true
mariadb:
shared: true
matomo:
enabled: true
shared: true
litellm:
enabled: true
sso:
enabled: true
shared: true
prometheus:
enabled: true
shared: true
tor:
enabled: true
hermes:
enabled: true
shared: true
openclaw:
enabled: true
shared: true
- services:
container_backup:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
wordpress:
multisite:
enabled: true
css:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
discourse:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
dashboard:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
email:
enabled: false
shared: false
logout:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
mariadb:
shared: false # nocheck: variants-static-override backup shared stays literally true
matomo:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
litellm:
enabled: false
sso:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
prometheus:
enabled: false
shared: false # nocheck: variants-static-override backup shared stays literally true
tor:
enabled: true
hermes:
enabled: false
shared: false
openclaw:
enabled: false
shared: false
addons:
activitypub:
enabled: false
server:
domains:
canonical:
- blog.{{ DOMAIN_PRIMARY }}
- biberblog.{{ DOMAIN_PRIMARY }}
- biber.blog.{{ DOMAIN_PRIMARY }}