1111 {% endif % }
1212{% endfor % }
1313
14+
15+ {% if salt[' pillar.get' ](' php:ng:version' ) is iterable % }
16+ {% for version in salt[' pillar.get' ](' php:ng:version' ) % }
17+ {% set conf_settings = odict(php.lookup.fpm.defaults) % }
18+ {% set first_version = salt[' pillar.get' ](' php:ng:version' )[0 ]| string % }
19+ {% set ini = php.lookup.fpm.ini| replace(first_version, version) % }
20+ {% set conf = php.lookup.fpm.conf| replace(first_version, version) % }
21+ {% set pools = php.lookup.fpm.pools| replace(first_version, version) % }
22+
23+ {% for key, value in conf_settings.items() % }
24+ {% if value is string % }
25+ {% do conf_settings.update({key: value.replace(first_version, version)}) % }
26+ {% endif % }
27+ {% endfor % }
28+ {% do conf_settings.global .update({' pid' : ' /var/run/php' + version + ' -fpm.pid' }) % }
29+ {% do conf_settings.global .update({' error_log' : ' /var/log/php' + version + ' -fpm.log' }) % }
30+
31+ php_fpm_ini_config_{{ version }}:
32+ {{ php_ini(ini, php.fpm.config.ini.opts, ini_settings) }}
33+
34+ php_fpm_conf_config_{{ version }}:
35+ {{ php_ini(conf, php.fpm.config.conf.opts, odict(conf_settings)) }}
36+
37+ {{ pools }}:
38+ file .directory:
39+ - name: {{ pools }}
40+ - user: {{ php.lookup.fpm.user }}
41+ - group: {{ php.lookup.fpm.group }}
42+ - file_mode: 755
43+ - make_dirs: True
44+ {% endfor % }
45+ {% else % }
46+
1447{% set conf_settings = php.lookup.fpm.defaults % }
1548{% do conf_settings.update(php.fpm.config.conf.settings) % }
1649
@@ -27,3 +60,4 @@ php_fpm_conf_config:
2760 - group: {{ php.lookup.fpm.group }}
2861 - file_mode: 755
2962 - make_dirs: True
63+ {% endif % }
0 commit comments