fix(web-app-mastodon,web-app-peertube): loop the vhosts without shadowing domain

tasks/utils/load/app.yml hands every loaded application `domain` as an
include var, so the vhost loops of Mastodon and PeerTube, which named
their item `domain`, made Ansible warn "The loop variable 'domain' is
already in use" (full-6 once, full-7 three times, full-8 twice). The loops
now name the item front_proxy_vhost and pass it to sys-stk-front-proxy as
`domain` in the include vars, which is the name its tasks/main.yml reads;
the two loop-var-shadow suppressions go with the shadowing.

Evidence: a stub playbook with an outer `domain` include var and a nested
include reproduces the warning with the old shape and shows none with the
new one; both shapes deliver each vhost to the outer and the nested role,
and the outer `domain` is intact after the loop.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kevinveenbirkenbachandClaude Opus 5.5 committed 2026-10-24 22:58:33 +02:00
1 parent c5cb05905b
commit 9e2afff43b
2 files changed
+6 -4

No files matched your search

+3 -2
View File
@@ -1,13 +1,14 @@
---
- include_tasks: utils/once/flag.yml
- name: "📂 Include setup for domain '{{ domain }}'"
- name: "📂 Include the front proxy for every {{ application_id }} domain"
include_role:
name: sys-stk-front-proxy
loop: "{{ lookup('domains', 'web-app-mastodon') }}"
loop_control:
loop_var: domain # nocheck: loop-var-shadow sys-stk-front-proxy takes the vhost through this name, see its tasks/main.yml front_proxy_domain
loop_var: front_proxy_vhost
vars:
domain: "{{ front_proxy_vhost }}"
http_port: "{{ lookup('config', application_id, 'services.mastodon.ports.local.http') }}"
webserver_websocket_location: "/api/v1/streaming"
websocket_port: "{{ lookup('config', application_id, 'services.mastodon.ports.local.websocket') }}"
+3 -2
View File
@@ -1,13 +1,14 @@
---
- include_tasks: utils/once/flag.yml
- name: "📂 Include front proxy for domain '{{ domain }}'"
- name: "📂 Include the front proxy for every {{ application_id }} domain"
include_role:
name: sys-stk-front-proxy
loop: "{{ lookup('domains', application_id) }}"
loop_control:
loop_var: domain # nocheck: loop-var-shadow sys-stk-front-proxy takes the vhost through this name, see its tasks/main.yml front_proxy_domain
loop_var: front_proxy_vhost
vars:
domain: "{{ front_proxy_vhost }}"
http_port: "{{ lookup('config', application_id, 'services.peertube.ports.local.http') }}"
websocket_port: "{{ lookup('config', application_id, 'services.peertube.ports.local.http') }}"