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.

61 lines
1.8KB

  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. apache-config-modules-perl-pkg:
  11. pkg.installed:
  12. - name: {{ apache.mod_perl2 }}
  13. - order: 180
  14. - require:
  15. - pkg: apache-package-install-pkg-installed
  16. - watch_in:
  17. - module: apache-service-running-restart
  18. - require_in:
  19. - module: apache-service-running-restart
  20. - module: apache-service-running-reload
  21. - service: apache-service-running
  22. {%- if grains['os_family'] in ('Suse', 'Debian',) %}
  23. cmd.run:
  24. - name: a2enmod perl
  25. - unless: ls {{ apache.moddir }}/perl.load || egrep "^APACHE_MODULES=" /etc/sysconfig/apache2 | grep ' perl'
  26. - order: 225
  27. - require:
  28. - pkg: apache-config-modules-perl-pkg
  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. {%- elif grains['os_family']=="FreeBSD" %}
  36. file.managed:
  37. - name: {{ apache.modulesdir }}/260_mod_perl.conf
  38. - source: salt://apache/files/{{ salt['grains.get']('os_family') }}/mod_perl.conf.jinja
  39. - mode: 644
  40. - makedirs: True
  41. - template: {{ apache.get('template_engine', 'jinja') }}
  42. - context:
  43. svcname: {{ apache.service.name }}
  44. - require:
  45. - pkg: apache-package-install-pkg-installed
  46. - watch_in:
  47. - module: apache-service-running-restart
  48. - require_in:
  49. - module: apache-service-running-restart
  50. - module: apache-service-running-reload
  51. - service: apache-service-running
  52. {%- endif %}