瀏覽代碼

Merge pull request #298 from bawuenet/master

Do not pass full apache context to vhost templates.
tags/v1.1.1
N 4 年之前
父節點
當前提交
0e93df3e1e
沒有連結到貢獻者的電子郵件帳戶。
共有 2 個檔案被更改,包括 9 行新增6 行删除
  1. +2
    -2
      apache/config/vhosts/proxy.tmpl
  2. +7
    -4
      apache/config/vhosts/standard.sls

+ 2
- 2
apache/config/vhosts/proxy.tmpl 查看文件

@@ -81,7 +81,7 @@
'Dav': loc.get('Dav', False),
} %}
<Location "{{ path }}">
{%- if apache.version == '2.4' %}
{%- if map.version == '2.4' %}
{% if lvals.get('Require') != False %}Require {{ lvals.Require }}{% endif %}
{%- else %}
{% if lvals.get('Order') != False %}Order {{ lvals.Order }}{% endif %}
@@ -98,7 +98,7 @@
'Dav': locmat.get('Dav', False),
} %}
<LocationMatch "{{ regpath }}">
{%- if apache.version == '2.4' %}
{%- if map.version == '2.4' %}
{% if lmvals.get('Require') != False %}Require {{ lmvals.Require }}{% endif %}
{%- else %}
{% if lmvals.get('Order') != False %}Order {{ lmvals.Order }}{% endif %}

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

@@ -5,6 +5,10 @@
{%- set sls_package_install = tplroot ~ '.package.install' %}
{%- set sls_service_running = tplroot ~ '.service.running' %}
{%- from tplroot ~ "/map.jinja" import apache with context %}
{#- The apache variable can grow _very_ large, especially the sites subkey.
Create a trimmed copy with config variables. #}
{%- set map = apache %}
{%- do map.pop('sites', None) %}

include:
- {{ sls_package_install }}
@@ -20,10 +24,9 @@ apache-config-vhosts-standard-{{ id }}:
- template: {{ apache.get('template_engine', 'jinja') }}
- makedirs: True
- context:
apache: {{ apache|json }}
id: {{ id|json }}
site: {{ site|json }}
map: {{ apache|json }}
id: {{ id|json }}
site: {{ site|json }}
map: {{ map|json }}
- require:
- pkg: apache-package-install-pkg-installed
- watch_in:

Loading…
取消
儲存