Skip to content

Commit 68610dd

Browse files
authored
Merge pull request #1 from IventureGroup/master
Add possibility to define default values for php-fpm pools
2 parents 51984f0 + 75bbeca commit 68610dd

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

php/ng/fpm/pools_config.sls

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@
1010
{% set pool_states = [] %}
1111
1212
{% for pool, config in php.fpm.pools.iteritems() %}
13+
{% if pool == 'defaults' %}{% continue %}{% endif %}
14+
{% for pkey, pvalues in config.get('settings', {}).iteritems() %}
15+
{% set pool_defaults = php.fpm.pools.get('defaults', {}).copy() %}
16+
{% do pool_defaults.update(pvalues) %}
17+
{% do pvalues.update(pool_defaults) %}
18+
{% endfor %}
1319
{% set state = 'php_fpm_pool_conf_' ~ loop.index0 %}
1420
{% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %}
1521

pillar.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,12 @@ php:
9393

9494
# settings for fpm-pools
9595
pools:
96+
# defaults will apply for each pools settings and can be overwritten by pool settings
97+
defaults:
98+
user: nginx
99+
group: nginx
100+
listen: /var/run/php-fpm-default.sock
101+
96102
# name of the pool file to be managed, this will be appended
97103
# to the path specified in php.ng.lookup.fpm.pools
98104
'mypool.conf':

0 commit comments

Comments
 (0)