mirror of
				https://github.com/kevinveenbirkenbach/computer-playbook.git
				synced 2025-11-03 19:58:14 +00:00 
			
		
		
		
	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:
		@@ -39,12 +39,16 @@
 | 
			
		||||
  include_tasks: "03_dns.yml"
 | 
			
		||||
  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 }}"
 | 
			
		||||
  include_role:
 | 
			
		||||
    name: web-opt-rdr-domains
 | 
			
		||||
  vars:
 | 
			
		||||
    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 } ]) )
 | 
			
		||||
      }}
 | 
			
		||||
    redirect_domain_mappings: "{{ BLUESKY_REDIRECT_DOMAIN_MAPPINGS }}"
 | 
			
		||||
		Reference in New Issue
	
	Block a user