Removed debuging message

This commit is contained in:
Kevin Veen-Birkenbach 2023-12-11 19:45:42 +01:00
parent 894902bda0
commit 46ccecf293

View File

@ -5,18 +5,13 @@
patterns: '*.*.conf' patterns: '*.*.conf'
register: conf_files register: conf_files
- name: Print conf_files domains
debug:
var: conf_files
- name: Filter domain names and remove .conf extension and path - name: Filter domain names and remove .conf extension and path
set_fact: set_fact:
filtered_domains: "{{ conf_files.files | map(attribute='path') | map('regex_search', domain_regex) | select('string') | map('regex_replace', '^/etc/nginx/conf.d/', '') | map('regex_replace', '.conf$', '') | list }}" filtered_domains: "{{ conf_files.files | map(attribute='path') | map('regex_search', domain_regex) | select('string') | map('regex_replace', '^/etc/nginx/conf.d/', '') | map('regex_replace', '.conf$', '') | list }}"
vars: vars:
domain_regex: '^/etc/nginx/conf.d/(?!www\.)[^/]+\.conf$' domain_regex: '^/etc/nginx/conf.d/(?!www\.)[^/]+\.conf$'
- name: The domains for which a www. redirect will be implemented
- name: Print filtered domains
debug: debug:
var: filtered_domains var: filtered_domains