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.

53 lines
1.6KB

  1. # -*- coding: utf-8 -*-
  2. # vim: ft=sls
  3. {%- set tplroot = tpldir.split('/')[0] %}
  4. {%- set sls_package_install = tplroot ~ '.package.install' %}
  5. {%- from tplroot ~ "/map.jinja" import apache with context %}
  6. include:
  7. - {{ sls_package_install }}
  8. apache-config-server-status:
  9. file.managed:
  10. - name: {{ apache.confdir }}/server-status{{ apache.confext }}
  11. - source: 'salt://apache/files/server-status.conf.jinja'
  12. - template: {{ apache.get('template_engine', 'jinja') }}
  13. - makedirs: True
  14. - context:
  15. apache: {{ apache|json }}
  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. {%- if grains['os_family'] == "Debian" %}
  25. apache-config-server-status-file-directory:
  26. file.directory:
  27. - name: /etc/apache2/conf-enabled
  28. - require:
  29. - pkg: apache-package-install-pkg-installed
  30. apache-config-server-status-cmd-run:
  31. cmd.run:
  32. - name: a2enconf server-status
  33. - unless: 'test -L /etc/apache2/conf-enabled/server-status.conf'
  34. - order: 225
  35. - require:
  36. - pkg: apache-package-install-pkg-installed
  37. - file: apache-config-server-status
  38. - file: apache-config-server-status-file-directory
  39. - watch_in:
  40. - module: apache-service-running-restart
  41. - require_in:
  42. - module: apache-service-running-restart
  43. - module: apache-service-running-reload
  44. - service: apache-service-running
  45. {%- endif %}