mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Optimized filter logic for all domains
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user