From 5c8b31c52ae8b97740abf5910a2cdd6367dfcde6 Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Thu, 10 Nov 2016 10:26:49 +0100 Subject: [PATCH] library/roles/nginx/tasks/nginx-virtualhosts.yml: Fix a problem with a new variable that's undefined by default. --- nginx/tasks/nginx-virtualhosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx/tasks/nginx-virtualhosts.yml b/nginx/tasks/nginx-virtualhosts.yml index f5877b76..d8756859 100644 --- a/nginx/tasks/nginx-virtualhosts.yml +++ b/nginx/tasks/nginx-virtualhosts.yml @@ -1,12 +1,12 @@ --- - name: Install the nginx virtualhost files template: src=nginx-virthost.j2 dest=/etc/nginx/sites-available/{{ item.virthost_name }} owner=root group=root mode=0444 - with_items: '{{ nginx_virthosts }}' + with_items: '{{ nginx_virthosts | default(omit) }}' notify: Reload nginx tags: [ 'nginx', 'virtualhost' ] - name: Enable the nginx virtualhosts file: src=/etc/nginx/sites-available/{{ item.virthost_name }} dest=/etc/nginx/sites-enabled/{{ item.virthost_name }} state=link - with_items: '{{ nginx_virthosts }}' + with_items: '{{ nginx_virthosts | default(omit) }}' notify: Reload nginx tags: [ 'nginx', 'virtualhost' ]