Nginx variable refactoring and general bug solving. Got interupted commit not tested

This commit is contained in:
2025-01-31 13:14:07 +01:00
parent b96d95f3e4
commit 11752f5e2e
23 changed files with 59 additions and 48 deletions

View File

@@ -1,7 +1,7 @@
---
- name: Find all .conf
ansible.builtin.find:
paths: "{{nginx_servers_directory}}"
paths: "{{nginx.directories.http.servers}}"
patterns: '*.*.conf'
register: conf_files
@@ -9,8 +9,8 @@
set_fact:
filtered_domains: "{{ conf_files.files | map(attribute='path') | map('regex_search', domain_regex) | select('string') | map('regex_replace', path_regex, '') | map('regex_replace', '.conf$', '') | list }}"
vars:
domain_regex: "^{{ nginx_servers_directory }}(?!www\\.)[^/]+\\.conf$"
path_regex: "^{{ nginx_servers_directory }}"
domain_regex: "^{{nginx.directories.http.servers}}(?!www\\.)[^/]+\\.conf$"
path_regex: "^{{nginx.directories.http.servers}}"
- name: The domains for which a www. redirect will be implemented
debug: