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.

34 lines
911B

  1. {% if grains['os_family']=="Debian" %}
  2. {% from "apache/map.jinja" import apache with context %}
  3. include:
  4. - apache
  5. {% if salt['file.file_exists' ]('/etc/apache2/conf-available/security.conf') %}
  6. apache_security-block:
  7. file.blockreplace:
  8. - name: /etc/apache2/conf-available/security.conf
  9. - marker_start: "# START managed zone -DO-NOT-EDIT-"
  10. - marker_end: "# END managed zone --"
  11. - append_if_not_found: True
  12. - show_changes: True
  13. - require:
  14. - pkg: apache
  15. - watch_in:
  16. - module: apache-reload
  17. {% for option, value in salt['pillar.get']('apache:security', {}).items() %}
  18. apache_manage-security-{{ option }}:
  19. file.accumulated:
  20. - filename: /etc/apache2/conf-available/security.conf
  21. - name: apache_manage-security-add-{{ option }}
  22. - text: "{{ option }} {{ value }}"
  23. - require_in:
  24. - file: apache_security-block
  25. {% endfor %}
  26. {% endif %}
  27. {% endif %}