library/roles/nginx/tasks/nginx-virtualhosts.yml: Fix a problem with a new variable that's undefined by default.

This commit is contained in:
Andrea Dell'Amico 2016-11-10 10:26:49 +01:00
parent e0bc74182b
commit 5c8b31c52a
1 changed files with 2 additions and 2 deletions

View File

@ -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' ]