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.

50 lines
1.5KB

  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. {%- if grains['os_family'] in ('Suse', 'Debian',) %}
  11. apache-config-modules-proxy-pkg:
  12. cmd.run:
  13. - name: a2enmod proxy
  14. - unless: ls {{ apache.moddir }}/proxy.load || egrep "^APACHE_MODULES=" /etc/sysconfig/apache2 | grep ' proxy'
  15. - order: 225
  16. - require:
  17. - pkg: apache-package-install-pkg-installed
  18. - watch_in:
  19. - module: apache-service-running-restart
  20. - require_in:
  21. - module: apache-service-running-restart
  22. - module: apache-service-running-reload
  23. - service: apache-service-running
  24. {%- elif grains['os_family']=="FreeBSD" %}
  25. apache-config-modules-proxy-file-managed:
  26. file.managed:
  27. - name: {{ apache.modulesdir }}/040_mod_proxy.conf
  28. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_proxy.conf.jinja
  29. - mode: 644
  30. - makedirs: True
  31. - template: {{ apache.get('template_engine', 'jinja') }}
  32. - context:
  33. svcname: {{ apache.service.name }}
  34. - require:
  35. - pkg: apache-package-install-pkg-installed
  36. - watch_in:
  37. - module: apache-service-running-restart
  38. - require_in:
  39. - module: apache-service-running-restart
  40. - module: apache-service-running-reload
  41. - service: apache-service-running
  42. {%- endif %}