Only remove/backup nginx.conf when necessary
This commit is contained in:
parent
e2cc1660cb
commit
9c80941892
@ -2,6 +2,7 @@
|
|||||||
- name: "(Setup: All NGINX) Check NGINX Default Configuration File Exists"
|
- name: "(Setup: All NGINX) Check NGINX Default Configuration File Exists"
|
||||||
stat:
|
stat:
|
||||||
path: /etc/nginx/conf.d/default.conf
|
path: /etc/nginx/conf.d/default.conf
|
||||||
|
when: main_upload_enable
|
||||||
register: default_exists
|
register: default_exists
|
||||||
|
|
||||||
- name: "(Setup: All NGINX) Backup NGINX Default Configuration File"
|
- name: "(Setup: All NGINX) Backup NGINX Default Configuration File"
|
||||||
@ -9,13 +10,13 @@
|
|||||||
remote_src: yes
|
remote_src: yes
|
||||||
src: /etc/nginx/conf.d/default.conf
|
src: /etc/nginx/conf.d/default.conf
|
||||||
dest: /etc/nginx/conf.d/default.conf.bak
|
dest: /etc/nginx/conf.d/default.conf.bak
|
||||||
when: default_exists.stat.exists
|
when: default_exists.stat.exists && main_upload_enable
|
||||||
|
|
||||||
- name: "(Setup: All NGINX) Delete NGINX Default Configuration File"
|
- name: "(Setup: All NGINX) Delete NGINX Default Configuration File"
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/conf.d/default.conf
|
path: /etc/nginx/conf.d/default.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: default_exists.stat.exists
|
when: default_exists.stat.exists && main_upload_enable
|
||||||
|
|
||||||
- name: "(Setup: All NGINX) Upload NGINX Main Configuration File"
|
- name: "(Setup: All NGINX) Upload NGINX Main Configuration File"
|
||||||
copy:
|
copy:
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
- name: "(Setup: All NGINX) Check NGINX Default Configuration File Exists"
|
- name: "(Setup: All NGINX) Check NGINX Default Configuration File Exists"
|
||||||
stat:
|
stat:
|
||||||
path: /etc/nginx/conf.d/default.conf
|
path: /etc/nginx/conf.d/default.conf
|
||||||
|
when: main_template_enable
|
||||||
register: default_exists
|
register: default_exists
|
||||||
|
|
||||||
- name: "(Setup: All NGINX) Backup NGINX Default Configuration File"
|
- name: "(Setup: All NGINX) Backup NGINX Default Configuration File"
|
||||||
@ -9,18 +10,19 @@
|
|||||||
remote_src: yes
|
remote_src: yes
|
||||||
src: /etc/nginx/conf.d/default.conf
|
src: /etc/nginx/conf.d/default.conf
|
||||||
dest: /etc/nginx/conf.d/default.conf.bak
|
dest: /etc/nginx/conf.d/default.conf.bak
|
||||||
when: default_exists.stat.exists
|
when: default_exists.stat.exists && main_template_enable
|
||||||
|
|
||||||
- name: "(Setup: All NGINX) Delete NGINX Default Configuration File"
|
- name: "(Setup: All NGINX) Delete NGINX Default Configuration File"
|
||||||
file:
|
file:
|
||||||
path: /etc/nginx/conf.d/default.conf
|
path: /etc/nginx/conf.d/default.conf
|
||||||
state: absent
|
state: absent
|
||||||
when: default_exists.stat.exists
|
when: default_exists.stat.exists && main_template_enable
|
||||||
|
|
||||||
- name: "(Setup: All NGINX) Dynamically Generate NGINX Main Configuration File"
|
- name: "(Setup: All NGINX) Dynamically Generate NGINX Main Configuration File"
|
||||||
template:
|
template:
|
||||||
src: nginx.conf.j2
|
src: nginx.conf.j2
|
||||||
dest: /etc/nginx/nginx.conf
|
dest: /etc/nginx/nginx.conf
|
||||||
|
when: main_template_enable
|
||||||
notify: "(Handler: All OSs) Reload NGINX"
|
notify: "(Handler: All OSs) Reload NGINX"
|
||||||
|
|
||||||
- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"
|
- name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"
|
||||||
|
Loading…
Reference in New Issue
Block a user