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.

49 line
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. {%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
  8. {%- if grains.os_family == 'Suse' %}
  9. include:
  10. - {{ sls_package_install }}
  11. - {{ sls_service_running }}
  12. {%- for flag in salt['pillar.get']('apache:flags:enabled', []) %}
  13. apache-config-flags-{{ flag }}-cmd-a2en:
  14. cmd.run:
  15. - name: a2enflag {{ flag }}
  16. - unless: egrep "^APACHE_SERVER_FLAGS=" /etc/sysconfig/apache2 |grep {{ flag }}
  17. - require:
  18. - pkg: apache-package-install-pkg-installed
  19. - watch_in:
  20. - module: apache-service-running-restart
  21. - require_in:
  22. - module: apache-service-running-restart
  23. - module: apache-service-running-reload
  24. - service: apache-service-running
  25. {%- endfor %}
  26. {%- for flag in salt['pillar.get']('apache:flags:disabled', []) %}
  27. apache-config-flags-{{ flag }}-a2dis:
  28. cmd.run:
  29. - name: a2disflag -f {{ flag }}
  30. - onlyif: egrep "^APACHE_SERVER_FLAGS=" /etc/sysconfig/apache2 | grep {{ flag }}
  31. - require:
  32. - pkg: apache-package-install-pkg-installed
  33. - watch_in:
  34. - module: apache-service-running-restart
  35. - require_in:
  36. - module: apache-service-running-restart
  37. - module: apache-service-running-reload
  38. - service: apache-service-running
  39. {%- endfor %}
  40. {%- endif %}