From 73d7140752a435bc789f5566e6263d0621c1114a Mon Sep 17 00:00:00 2001 From: Asa Gage Date: Thu, 10 Dec 2015 09:00:39 -0500 Subject: [PATCH] updating vhost conditional expressions to check count of list members --- tasks/vhosts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/vhosts.yml b/tasks/vhosts.yml index 5ee8ec2..621ab6b 100644 --- a/tasks/vhosts.yml +++ b/tasks/vhosts.yml @@ -11,12 +11,12 @@ src: vhosts.j2 dest: "{{ nginx_vhost_path }}/vhosts.conf" mode: 0644 - when: nginx_vhosts + when: nginx_vhosts|length > 0 notify: restart nginx - name: Remove managed vhost config file (if no vhosts are configured). file: path: "{{ nginx_vhost_path }}/vhosts.conf" state: absent - when: not nginx_vhosts + when: nginx_vhosts|length == 0 notify: restart nginx