ansible-role-nginx/tasks/conf/cleanup-config.yml

18 lines
589 B
YAML
Raw Normal View History

---
2020-06-12 23:42:14 +02:00
- name: "(Setup: All OSs) Find NGINX Configuration Files"
find:
paths: "{{ item.directory }}"
patterns: "*.conf"
recurse: "{{ item.recurse | default(false) }}"
loop: "{{ nginx_cleanup_config_paths }}"
when: nginx_cleanup_config_paths is defined
2020-06-12 23:42:14 +02:00
register: nginx_config_files
- name: "(Setup: All OSs) Remove NGINX Configuration Files"
file:
path: "{{ item }}"
state: absent
loop: >-
{{ nginx_config_files.results | default('') | map(attribute='files') | sum(start=[]) | map(attribute='path') | list
+ nginx_cleanup_config_files | default('') }}