Saltstack Official PHP Formula
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

39 lines
1.0KB

  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 %}