Saltstack Official Apache Formula
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

45 行
1.3KB

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