From e20dd288bf7ee44795b7b1fa46a00641e2880241 Mon Sep 17 00:00:00 2001 From: Alessandro Fael Garcia Date: Mon, 16 Apr 2018 16:41:46 -0700 Subject: [PATCH] Check if configuration file is defined --- tasks/conf/push-config.yml | 4 ++-- tasks/conf/template-config.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tasks/conf/push-config.yml b/tasks/conf/push-config.yml index ed168e6..40ff267 100644 --- a/tasks/conf/push-config.yml +++ b/tasks/conf/push-config.yml @@ -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: diff --git a/tasks/conf/template-config.yml b/tasks/conf/template-config.yml index 0819d54..314a5f0 100644 --- a/tasks/conf/template-config.yml +++ b/tasks/conf/template-config.yml @@ -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: