Optimized filter logic for all domains

This commit is contained in:
2025-05-17 11:54:23 +02:00
parent ca5c3c6e8a
commit 76f303da27
3 changed files with 106 additions and 12 deletions

View File

@@ -75,18 +75,13 @@
set_fact:
base_sld_domains: "{{ base_domains | map('regex_replace', '^(?:.*\\.)?([^.]+\\.[^.]+)$', '\\1') | list | unique | sort }}"
- name: Initialise all_domains as empty list
set_fact:
all_domains: []
- name: Build all_domains with base + www via loop
set_fact:
all_domains: "{{ all_domains + [ item, 'www.' ~ item ] }}"
loop: "{{ base_domains }}"
- name: Deduplicate and sort all_domains
set_fact:
all_domains: "{{ all_domains | unique | sort }}"
- set_fact:
all_domains: >-
{{ domains
| generate_all_domains(
('www_redirect' in group_names)
)
}}
- name: "Merged Variables"
# Add new merged variables here