Saltstack Official Apache Formula
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {%- set tplroot = tpldir.split('/')[0] %}
  4. {%- set sls_package_install = tplroot ~ '.package.install' %}
  5. {%- set sls_service_running = tplroot ~ '.service.running' %}
  6. {%- from tplroot ~ "/map.jinja" import apache with context %}
  7. {%- if grains.os_family in ('Debian', 'FreeBSD') %}
  8. include:
  9. - {{ sls_package_install }}
  10. - {{ sls_service_running }}
  11. apache-config-manage-security-{{ grains.os_family }}:
  12. file.managed:
  13. {%- if grains.os_family == "Debian" %}
  14. - onlyif: test -f /etc/apache2/conf-available/security.conf
  15. - name: /etc/apache2/conf-available/security.conf
  16. {%- elif grains.os_family == "FreeBSD" %}
  17. - name: {{ apache.confdir + '/security.conf' }}
  18. {%- endif %}
  19. - source:
  20. - salt://apache/files/{{ grains.os_family }}/security.conf.jinja
  21. - salt://apache/files/ssl/security.conf.jinja
  22. - mode: 644
  23. - makedirs: True
  24. - template: {{ apache.get('template_engine', 'jinja') }}
  25. - context:
  26. apache: {{ apache | json }}
  27. - require:
  28. - pkg: apache-package-install-pkg-installed
  29. - watch_in:
  30. - module: apache-service-running-restart
  31. - require_in:
  32. - module: apache-service-running-restart
  33. - module: apache-service-running-reload
  34. - service: apache-service-running
  35. {%- endif %}