浏览代码

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.
tags/v0.37.4
Jonathan Ballet 10 年前
父节点
当前提交
42426f3f4a
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. +3
    -1
      apache/vhosts/standard.sls

+ 3
- 1
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 }}:

正在加载...
取消
保存