From 42426f3f4ab7b1b30f9e8ae17e9991ae4f6fdb41 Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Wed, 25 Mar 2015 15:06:18 +0100 Subject: [PATCH] Don't fail on missing DocumentRoot If the DocumentRoot value wasn't set, applying the state would cause the following error: ID: site.example.com-documentroot Function: file.directory Name: None Result: False Comment: Specified file None is not an absolute path Started: 15:07:05.596723 Duration: 4.929 ms Changes: This fixes the problem by not trying to check for the DocumentRoot directory is the value is missing. --- apache/vhosts/standard.sls | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apache/vhosts/standard.sls b/apache/vhosts/standard.sls index 3579e12..15efe20 100644 --- a/apache/vhosts/standard.sls +++ b/apache/vhosts/standard.sls @@ -19,12 +19,14 @@ include: - pkg: apache - watch_in: - module: apache-reload - + +{% if 'DocumentRoot' in site %} {{ id }}-documentroot: file.directory: - unless: test -d {{ site.get('DocumentRoot') }} - name: {{ site.get('DocumentRoot') }} - makedirs: True +{% endif %} {% if grains.os_family == 'Debian' %} a2ensite {{ id }}{{ apache.confext }}: