Skip to content

Commit dab0e5d

Browse files
authored
Merge pull request #25 from nginxinc/(bug)/check-file-exists
Check if configuration file is defined
2 parents a8aeee1 + e20dd28 commit dab0e5d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tasks/conf/push-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
remote_src: yes
1111
src: /etc/nginx/conf.d/default.conf
1212
dest: /etc/nginx/conf.d/default.conf.bak
13-
when: default_exists.stat.exists and main_push_enable
13+
when: default_exists.stat.exists is defined and default_exists.stat.isreg and main_push_enable
1414

1515
- name: "(Setup: All NGINX) Delete NGINX Default Configuration File"
1616
file:
1717
path: /etc/nginx/conf.d/default.conf
1818
state: absent
19-
when: default_exists.stat.exists and main_push_enable
19+
when: default_exists.stat.exists is defined and default_exists.stat.isreg and main_push_enable
2020

2121
- name: "(Setup: All NGINX) Upload NGINX Main Configuration File"
2222
copy:

tasks/conf/template-config.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010
remote_src: yes
1111
src: /etc/nginx/conf.d/default.conf
1212
dest: /etc/nginx/conf.d/default.conf.bak
13-
when: default_exists.stat.exists and main_template_enable
13+
when: default_exists.stat.exists is defined and default_exists.stat.isreg and main_template_enable
1414

1515
- name: "(Setup: All NGINX) Delete NGINX Default Configuration File"
1616
file:
1717
path: /etc/nginx/conf.d/default.conf
1818
state: absent
19-
when: default_exists.stat.exists and main_template_enable
19+
when: default_exists.stat.exists is defined and default_exists.stat.isreg and main_template_enable
2020

2121
- name: "(Setup: All NGINX) Dynamically Generate NGINX Main Configuration File"
2222
template:

0 commit comments

Comments
 (0)