Check if configuration file is defined

This commit is contained in:
Alessandro Fael Garcia 2018-04-16 16:41:46 -07:00
parent a8aeee176f
commit e20dd288bf
2 changed files with 4 additions and 4 deletions

View File

@ -10,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 and main_push_enable
when: default_exists.stat.exists is defined and default_exists.stat.isreg and main_push_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 and main_push_enable
when: default_exists.stat.exists is defined and default_exists.stat.isreg and main_push_enable
- name: "(Setup: All NGINX) Upload NGINX Main Configuration File"
copy:

View File

@ -10,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 and main_template_enable
when: default_exists.stat.exists is defined and default_exists.stat.isreg and 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 and main_template_enable
when: default_exists.stat.exists is defined and default_exists.stat.isreg and main_template_enable
- name: "(Setup: All NGINX) Dynamically Generate NGINX Main Configuration File"
template: