2015-12-14 15:12:20 +01:00
|
|
|
{% from "apache/map.jinja" import apache with context %}
|
|
|
|
|
2017-05-17 07:53:58 +02:00
|
|
|
{%- macro security_config(name) %}
|
|
|
|
{{ name }}:
|
|
|
|
file.managed:
|
|
|
|
- source:
|
|
|
|
- salt://apache/files/{{ salt['grains.get']('os_family') }}/security.conf.jinja
|
|
|
|
- salt://apache/files/security.conf.jinja
|
|
|
|
- mode: 644
|
|
|
|
- template: jinja
|
|
|
|
- require:
|
|
|
|
- pkg: apache
|
|
|
|
- watch_in:
|
|
|
|
- module: apache-restart
|
|
|
|
{%- endmacro %}
|
|
|
|
|
2015-12-14 15:12:20 +01:00
|
|
|
include:
|
|
|
|
- apache
|
|
|
|
|
2017-01-08 13:45:36 +01:00
|
|
|
{% if grains['os_family']=="Debian" %}
|
|
|
|
|
2017-05-17 07:53:58 +02:00
|
|
|
{{ security_config('/etc/apache2/conf-available/security.conf') }}
|
2018-06-07 14:52:57 +02:00
|
|
|
- onlyif: test -f '/etc/apache2/conf-available/security.conf'
|
2015-12-14 15:12:20 +01:00
|
|
|
|
2017-01-08 13:45:36 +01:00
|
|
|
{% elif grains['os_family']=="FreeBSD" %}
|
2017-05-17 07:53:58 +02:00
|
|
|
{{ security_config(apache.confdir+'/security.conf') }}
|
2015-12-16 14:42:59 +01:00
|
|
|
{% endif %}
|