apache-formula/apache/manage_security.sls
Adrien "ze" Urban 76f05dda8e manage_security: fix file presence detection
Detect runtime, rather than before starting/installing anything.
2018-06-07 14:52:57 +02:00

28 lines
710 B
Plaintext

{% from "apache/map.jinja" import apache with context %}
{%- 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 %}
include:
- apache
{% if grains['os_family']=="Debian" %}
{{ security_config('/etc/apache2/conf-available/security.conf') }}
- onlyif: test -f '/etc/apache2/conf-available/security.conf'
{% elif grains['os_family']=="FreeBSD" %}
{{ security_config(apache.confdir+'/security.conf') }}
{% endif %}