浏览代码

Allow global directives to be added to apache config

tags/v0.37.4
Rowcliffe Browne 9 年前
父节点
当前提交
2557d3d1c8
共有 5 个文件被更改,包括 31 次插入0 次删除
  1. +14
    -0
      apache/config.sls
  2. +4
    -0
      apache/files/RedHat/apache-2.2.config.jinja
  3. +4
    -0
      apache/files/RedHat/apache-2.4.config.jinja
  4. +4
    -0
      apache/files/Suse/global.config.jinja
  5. +5
    -0
      pillar.example

+ 14
- 0
apache/config.sls 查看文件

@@ -42,3 +42,17 @@ include:
- watch_in:
- service: apache
{% endif %}

{% if grains['os_family']=="Suse" %}
/etc/apache2/sysconfig.d/global.conf:
file.managed:
- template: jinja
- source:
- salt://apache/files/{{ salt['grains.get']('os_family') }}/global.config.jinja
- require:
- pkg: apache
- watch_in:
- service: apache
- context:
apache: {{ apache }}
{% endif %}

+ 4
- 0
apache/files/RedHat/apache-2.2.config.jinja 查看文件

@@ -416,6 +416,10 @@ AddDefaultCharset UTF-8
#EnableMMAP off
EnableSendfile on

{%- for directive, dvalue in salt['pillar.get']('apache:global', {}).items() %}
{{ directive }} {{ dvalue }}
{%- endfor %}

# Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.

+ 4
- 0
apache/files/RedHat/apache-2.4.config.jinja 查看文件

@@ -350,6 +350,10 @@ AddDefaultCharset UTF-8
#EnableMMAP off
EnableSendfile on

{%- for directive, dvalue in salt['pillar.get']('apache:global', {}).items() %}
{{ directive }} {{ dvalue }}
{%- endfor %}

# Supplemental configuration
#
# Load config files in the "/etc/httpd/conf.d" directory, if any.

+ 4
- 0
apache/files/Suse/global.config.jinja 查看文件

@@ -0,0 +1,4 @@
{%- for directive, dvalue in salt['pillar.get']('apache:global', {}).items() %}
{{ directive }} {{ dvalue }}
{%- endfor %}


+ 5
- 0
pillar.example 查看文件

@@ -18,6 +18,11 @@ apache:
# ``apache.mod_wsgi`` formula additional configuration:
mod_wsgi: mod_wsgi

global:
# global apache directives
AllowEncodedSlashes: "On"


# ``apache.vhosts`` formula additional configuration:
sites:
example.net:

正在加载...
取消
保存