Add option to remove a specific list of files (#291)
This commit is contained in:
parent
36b42e563a
commit
b089b03811
@ -94,13 +94,16 @@ nginx_modules:
|
||||
|
||||
# Remove previously existing NGINX configuration files.
|
||||
# You can specify a list of paths you wish to remove.
|
||||
# Alternatively you can also choose whether to recurse through the paths specified.
|
||||
# You can also choose whether to recurse through the paths specified.
|
||||
# Alternatively you can specify the list of files you wish to remove.
|
||||
# Default is false.
|
||||
nginx_cleanup_config: false
|
||||
nginx_cleanup_config_path:
|
||||
nginx_cleanup_config_paths:
|
||||
- directory:
|
||||
- /etc/nginx/conf.d
|
||||
recurse: false
|
||||
# nginx_cleanup_config_files:
|
||||
# - /etc/nginx/conf.d/default.conf
|
||||
|
||||
# Set selinux enforcing for nginx (Centos/Redhat only) - you may need to open ports on your own
|
||||
nginx_selinux: false
|
||||
|
@ -14,10 +14,12 @@
|
||||
- 443
|
||||
|
||||
nginx_cleanup_config: true
|
||||
nginx_cleanup_config_path:
|
||||
nginx_cleanup_config_paths:
|
||||
- directory:
|
||||
- /etc/nginx/conf.d
|
||||
recurse: false
|
||||
nginx_cleanup_config_files:
|
||||
- /etc/nginx/conf.d/default.conf
|
||||
|
||||
nginx_modules:
|
||||
njs: true
|
||||
|
@ -4,11 +4,14 @@
|
||||
paths: "{{ item.directory }}"
|
||||
patterns: "*.conf"
|
||||
recurse: "{{ item.recurse | default(false) }}"
|
||||
loop: "{{ nginx_cleanup_config_path }}"
|
||||
loop: "{{ nginx_cleanup_config_paths }}"
|
||||
when: nginx_cleanup_config_paths is defined
|
||||
register: nginx_config_files
|
||||
|
||||
- name: "(Setup: All OSs) Remove NGINX Configuration Files"
|
||||
file:
|
||||
path: "{{ item }}"
|
||||
state: absent
|
||||
loop: "{{ nginx_config_files.results | map(attribute='files') | sum(start=[]) | map(attribute='path') | list }}"
|
||||
loop: >-
|
||||
{{ nginx_config_files.results | default('') | map(attribute='files') | sum(start=[]) | map(attribute='path') | list
|
||||
+ nginx_cleanup_config_files | default('') }}
|
||||
|
Loading…
Reference in New Issue
Block a user