From d1871d970696228ebfdadd098f9cc17627f4693b Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 12 Sep 2016 20:58:21 +0300 Subject: [PATCH] roles/nginx: Check for variable existence before testing Some vhosts might not have WordPress so we need to be better about testing for this before checking its value. --- roles/nginx/tasks/vhosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/nginx/tasks/vhosts.yml b/roles/nginx/tasks/vhosts.yml index 4528db6..77a5511 100644 --- a/roles/nginx/tasks/vhosts.yml +++ b/roles/nginx/tasks/vhosts.yml @@ -22,13 +22,13 @@ - name: Install WordPress git: repo=https://github.com/WordPress/WordPress.git dest={{ nginx_root_prefix }}/{{ item.domain_name }}/wordpress version={{ item.wordpress_version }} depth=1 force=yes - when: item.has_wordpress == True + when: item.has_wordpress is defined and item.has_wordpress == True with_items: "{{ nginx_vhosts }}" tags: wordpress - name: Fix WordPress directory permissions file: path={{ nginx_root_prefix }}/{{ item.domain_name }} state=directory owner=nginx group=nginx recurse=yes - when: item.has_wordpress == True + when: item.has_wordpress is defined and item.has_wordpress == True with_items: "{{ nginx_vhosts }}" tags: wordpress