Saltstack Official Apache Formula
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

52 lines
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_http-pkg:
  13. cmd.run:
  14. - name: a2enmod proxy_http
  15. - unless: ls {{ apache.moddir }}/proxy_http.load || egrep "^APACHE_MODULES=" /etc/sysconfig/apache2 | grep proxy_http
  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_http-file-managed:
  28. file.managed:
  29. - name: {{ apache.modulesdir }}/040_mod_proxy_http.conf
  30. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_proxy_http.conf.jinja
  31. - mode: 644
  32. - makedirs: True
  33. - template: {{ apache.get('template_engine', 'jinja') }}
  34. - context:
  35. svcname: {{ apache.service.name }}
  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 %}