瀏覽代碼

Create defaul vhost directories when DocumentRoot is not set

master
Cody Hiar 9 年之前
父節點
當前提交
07b2a9f9f5
共有 1 個檔案被更改,包括 3 行新增4 行删除
  1. +3
    -4
      apache/vhosts/standard.sls

+ 3
- 4
apache/vhosts/standard.sls 查看文件

@@ -4,6 +4,7 @@ include:
- apache

{% for id, site in salt['pillar.get']('apache:sites', {}).items() %}
{% set documentroot = site.get('DocumentRoot', '{0}/{1}'.format(apache.wwwdir, sitename)) %}

{{ id }}:
file:
@@ -20,13 +21,11 @@ include:
- watch_in:
- module: apache-reload

{% if 'DocumentRoot' in site %}
{{ id }}-documentroot:
file.directory:
- unless: test -d {{ site.get('DocumentRoot') }}
- name: {{ site.get('DocumentRoot') }}
- unless: test -d {{ documentroot }}
- name: {{ documentroot }}
- makedirs: True
{% endif %}

{% if grains.os_family == 'Debian' %}
a2ensite {{ id }}{{ apache.confext }}:

Loading…
取消
儲存