mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Removed bugs and implemented new server config structure
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
---
|
||||
- name: Find all .conf
|
||||
ansible.builtin.find:
|
||||
paths: "/etc/nginx/conf.d/"
|
||||
paths: "{{nginx_servers_directory}}"
|
||||
patterns: '*.*.conf'
|
||||
register: conf_files
|
||||
|
||||
- name: Filter domain names and remove .conf extension and path
|
||||
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', '^{{nginx_servers_directory}}', '') | map('regex_replace', '.conf$', '') | list }}"
|
||||
vars:
|
||||
domain_regex: '^/etc/nginx/conf.d/(?!www\.)[^/]+\.conf$'
|
||||
domain_regex: '^{{nginx_servers_directory}}(?!www\.)[^/]+\.conf$'
|
||||
|
||||
- name: The domains for which a www. redirect will be implemented
|
||||
debug:
|
||||
|
Reference in New Issue
Block a user