Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
736B

  1. {% from "apache/map.jinja" import apache with context %}
  2. {%- macro security_config(name) %}
  3. {{ name }}:
  4. file.managed:
  5. - source:
  6. - salt://apache/files/{{ salt['grains.get']('os_family') }}/security.conf.jinja
  7. - salt://apache/files/security.conf.jinja
  8. - mode: 644
  9. - template: jinja
  10. - require:
  11. - pkg: apache
  12. - watch_in:
  13. - module: apache-restart
  14. {%- endmacro %}
  15. include:
  16. - apache
  17. {% if grains['os_family']=="Debian" %}
  18. {% if salt['file.file_exists' ]('/etc/apache2/conf-available/security.conf') %}
  19. {{ security_config('/etc/apache2/conf-available/security.conf') }}
  20. {% endif %}
  21. {% elif grains['os_family']=="FreeBSD" %}
  22. {{ security_config(apache.confdir+'/security.conf') }}
  23. {% endif %}