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

52 行
1.6KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {%- set tplroot = tpldir.split('/')[0] %}
  4. {%- set sls_service_running = tplroot ~ '.service.running' %}
  5. {%- set sls_package_install = tplroot ~ '.package.install' %}
  6. {%- from tplroot ~ "/map.jinja" import apache with context %}
  7. include:
  8. - {{ sls_service_running }}
  9. - {{ sls_package_install }}
  10. - .mod_proxy
  11. {%- if grains['os_family'] in ('Suse', 'Debian',) %}
  12. apache-config-modules-proxy_ajp-pkg:
  13. cmd.run:
  14. - name: a2enmod proxy_ajp
  15. - unless: ls {{ apache.moddir }}/proxy_ajp.load || egrep "^APACHE_MODULES=" /etc/sysconfig/apache2 | grep proxy_ajp
  16. - order: 225
  17. - require:
  18. - pkg: apache-package-install-pkg-installed
  19. # cmd: a2enmod proxy
  20. - watch_in:
  21. - module: apache-service-running-restart
  22. - require_in:
  23. - module: apache-service-running-restart
  24. - module: apache-service-running-reload
  25. - service: apache-service-running
  26. {%- elif grains['os_family']=="FreeBSD" %}
  27. apache-config-modules-proxy_ajp-file-managed:
  28. file.managed:
  29. - name: {{ apache.modulesdir }}/040_mod_proxy_ajp.conf
  30. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_proxy_ajp.conf.jinja
  31. - mode: 644
  32. - makedirs: True
  33. - template: {{ apache.get('template_engine', 'jinja') }}
  34. - context:
  35. apache: {{ apache|json }}
  36. - require:
  37. - pkg: apache-package-install-pkg-installed
  38. - watch_in:
  39. - module: apache-service-running-restart
  40. - require_in:
  41. - module: apache-service-running-restart
  42. - module: apache-service-running-reload
  43. - service: apache-service-running
  44. {%- endif %}