diff --git a/tasks/conf/push-config.yml b/tasks/conf/push-config.yml index cbb052e..d8bbb88 100644 --- a/tasks/conf/push-config.yml +++ b/tasks/conf/push-config.yml @@ -2,6 +2,7 @@ - name: "(Setup: All NGINX) Check NGINX Default Configuration File Exists" stat: path: /etc/nginx/conf.d/default.conf + when: main_upload_enable register: default_exists - name: "(Setup: All NGINX) Backup NGINX Default Configuration File" @@ -9,13 +10,13 @@ remote_src: yes src: /etc/nginx/conf.d/default.conf 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" file: path: /etc/nginx/conf.d/default.conf state: absent - when: default_exists.stat.exists + when: default_exists.stat.exists && main_upload_enable - name: "(Setup: All NGINX) Upload NGINX Main Configuration File" copy: diff --git a/tasks/conf/template-config.yml b/tasks/conf/template-config.yml index 5d54b77..e75bfb2 100644 --- a/tasks/conf/template-config.yml +++ b/tasks/conf/template-config.yml @@ -2,6 +2,7 @@ - name: "(Setup: All NGINX) Check NGINX Default Configuration File Exists" stat: path: /etc/nginx/conf.d/default.conf + when: main_template_enable register: default_exists - name: "(Setup: All NGINX) Backup NGINX Default Configuration File" @@ -9,18 +10,19 @@ remote_src: yes src: /etc/nginx/conf.d/default.conf 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" file: path: /etc/nginx/conf.d/default.conf 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" template: src: nginx.conf.j2 dest: /etc/nginx/nginx.conf + when: main_template_enable notify: "(Handler: All OSs) Reload NGINX" - name: "(Setup: All NGINX) Ensure NGINX HTTP Directory Exists"