Refactor: force early evaluation of BlueSky redirect_domain_mappings before include_role

Ensures that redirect_domain_mappings is resolved via set_fact
before passing it into the web-opt-rdr-domains role.
See: https://chatgpt.com/share/68d51125-14f4-800f-be6a-a7be3faeb028
This commit is contained in:
2025-09-25 11:55:13 +02:00
parent 189aaaa9ec
commit 1f99a6b84b

View File

@@ -39,12 +39,16 @@
include_tasks: "03_dns.yml" include_tasks: "03_dns.yml"
when: DNS_PROVIDER | lower == 'cloudflare' when: DNS_PROVIDER | lower == 'cloudflare'
- name: Resolve redirect_domain_mappings now (before include_role)
set_fact:
BLUESKY_REDIRECT_DOMAIN_MAPPINGS: >-
{{
( (BLUESKY_WEB_ENABLED | bool) | ternary([], [ {'source': BLUESKY_WEB_DOMAIN, 'target': BLUESKY_API_DOMAIN } ]) )
+ ( (BLUESKY_VIEW_ENABLED | bool) | ternary([], [ {'source': BLUESKY_VIEW_DOMAIN, 'target': BLUESKY_API_DOMAIN } ]) )
}}
- name: "Redirect deactivated BlueSky Services to {{ BLUESKY_API_DOMAIN }}" - name: "Redirect deactivated BlueSky Services to {{ BLUESKY_API_DOMAIN }}"
include_role: include_role:
name: web-opt-rdr-domains name: web-opt-rdr-domains
vars: vars:
redirect_domain_mappings: >- redirect_domain_mappings: "{{ BLUESKY_REDIRECT_DOMAIN_MAPPINGS }}"
{{
( (BLUESKY_WEB_ENABLED | bool) | ternary([], [ {'source': BLUESKY_WEB_DOMAIN, 'target': BLUESKY_API_DOMAIN } ]) )
+ ( (BLUESKY_VIEW_ENABLED | bool) | ternary([], [ {'source': BLUESKY_VIEW_DOMAIN, 'target': BLUESKY_API_DOMAIN } ]) )
}}