- php.fpm.pools | - php.fpm.pools | ||||
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} | {% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} | ||||
extend: | extend: | ||||
php_fpm_service: | |||||
{% if pillar_php_version is iterable and pillar_php_version is not string %} | |||||
{% for version in pillar_php_version %} | |||||
php_fpm_service_{{ version }}: | |||||
service: | service: | ||||
- watch: | - watch: | ||||
{% if pillar_php_version is iterable and pillar_php_version is not string %} | |||||
{% for version in pillar_php_version %} | |||||
- file: php_fpm_ini_config_{{ version }} | - file: php_fpm_ini_config_{{ version }} | ||||
- file: php_fpm_conf_config_{{ version }} | - file: php_fpm_conf_config_{{ version }} | ||||
{% endfor %} | |||||
{% else %} | |||||
- file: php_fpm_ini_config | |||||
- file: php_fpm_conf_config | |||||
{% endif %} | |||||
- require: | - require: | ||||
- sls: php.fpm.config | - sls: php.fpm.config | ||||
{% if pillar_php_version is iterable and pillar_php_version is not string %} | |||||
{% for version in pillar_php_version %} | |||||
php_fpm_ini_config_{{ version }}: | php_fpm_ini_config_{{ version }}: | ||||
file: | file: | ||||
- require: | - require: | ||||
- pkg: php_install_fpm | - pkg: php_install_fpm | ||||
php_fpm_conf_config_{{ version }}: | php_fpm_conf_config_{{ version }}: | ||||
file: | file: | ||||
- require: | - require: | ||||
- pkg: php_install_fpm | - pkg: php_install_fpm | ||||
{% endfor %} | |||||
{% else %} | |||||
{% endfor %} | |||||
{% else %} | |||||
php_fpm_service: | |||||
service: | |||||
- watch: | |||||
- file: php_fpm_ini_config | |||||
- file: php_fpm_conf_config | |||||
- require: | |||||
- sls: php.fpm.config | |||||
php_fpm_ini_config: | php_fpm_ini_config: | ||||
file: | file: | ||||
- require: | - require: | ||||
- pkg: php_install_fpm | - pkg: php_install_fpm | ||||
php_fpm_conf_config: | php_fpm_conf_config: | ||||
file: | file: | ||||
- require: | - require: | ||||
- pkg: php_install_fpm | - pkg: php_install_fpm | ||||
{% endif %} | |||||
{% endif %} |
- php.fpm.service | - php.fpm.service | ||||
- php.fpm.pools_config | - php.fpm.pools_config | ||||
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} | |||||
{% if pool_states %} | {% if pool_states %} | ||||
extend: | extend: | ||||
{% if pillar_php_version is iterable and pillar_php_version is not string %} | |||||
{% for version in pillar_php_version %} | |||||
php_fpm_service_{{ version }}: | |||||
service: | |||||
- watch: | |||||
{{ file_requisites(pool_states) }} | |||||
- require: | |||||
{{ file_requisites(pool_states) }} | |||||
{% endfor %} | |||||
{% else %} | |||||
php_fpm_service: | php_fpm_service: | ||||
service: | service: | ||||
- watch: | - watch: | ||||
{{ file_requisites(pool_states) }} | {{ file_requisites(pool_states) }} | ||||
- require: | - require: | ||||
{{ file_requisites(pool_states) }} | {{ file_requisites(pool_states) }} | ||||
{% endif %} | |||||
{% endif %} | {% endif %} |
{% from "php/macro.jinja" import sls_block %} | {% from "php/macro.jinja" import sls_block %} | ||||
{% set service_function = {True:'running', False:'dead'}.get(php.fpm.service.enabled) %} | {% set service_function = {True:'running', False:'dead'}.get(php.fpm.service.enabled) %} | ||||
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} | |||||
include: | include: | ||||
- php.fpm.install | - php.fpm.install | ||||
{% if pillar_php_version is iterable and pillar_php_version is not string %} | |||||
{% for version in pillar_php_version %} | |||||
php_fpm_service_{{ version }}: | |||||
service.{{ service_function }}: | |||||
{{ sls_block(php.fpm.service.opts) }} | |||||
- name: {{ 'php' ~ version ~ '-fpm' }} | |||||
- enable: {{ php.fpm.service.enabled }} | |||||
- require: | |||||
- sls: php.fpm.install | |||||
- watch: | |||||
- pkg: php_install_fpm | |||||
{% endfor %} | |||||
{% else %} | |||||
php_fpm_service: | php_fpm_service: | ||||
service.{{ service_function }}: | service.{{ service_function }}: | ||||
{{ sls_block(php.fpm.service.opts) }} | {{ sls_block(php.fpm.service.opts) }} | ||||
- sls: php.fpm.install | - sls: php.fpm.install | ||||
- watch: | - watch: | ||||
- pkg: php_install_fpm | - pkg: php_install_fpm | ||||
{% endif %} |