Saltstack Official Apache Formula
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

manage_security.sls 736B

12345678910111213141516171819202122232425262728
  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 %}