Saltstack Official PHP 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.

service.sls 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. # Manages the php-fpm service.
  2. {% from "php/map.jinja" import php with context %}
  3. {% from "php/macro.jinja" import sls_block %}
  4. {% set service_function = {True:'running', False:'dead'}.get(php.fpm.service.enabled) %}
  5. {% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
  6. include:
  7. - php.fpm.install
  8. {% if pillar_php_version is iterable and pillar_php_version is not string %}
  9. {% for version in pillar_php_version %}
  10. php_fpm_service_{{ version }}:
  11. service.{{ service_function }}:
  12. {{ sls_block(php.fpm.service.opts) }}
  13. - name: {{ 'php' ~ version ~ '-fpm' }}
  14. - enable: {{ php.fpm.service.enabled }}
  15. - require:
  16. - sls: php.fpm.install
  17. - watch:
  18. - pkg: php_install_fpm
  19. {% endfor %}
  20. {% else %}
  21. php_fpm_service:
  22. service.{{ service_function }}:
  23. {{ sls_block(php.fpm.service.opts) }}
  24. - name: {{ php.lookup.fpm.service }}
  25. - enable: {{ php.fpm.service.enabled }}
  26. - require:
  27. - sls: php.fpm.install
  28. - watch:
  29. - pkg: php_install_fpm
  30. {% endif %}