Browse Source

Merge pull request #123 from vquiering/master

Make php.ng.maps.jinja work for php5 on Debian
tags/v0.34.0
Niels Abspoel 7 years ago
parent
commit
6fad18a5a1
3 changed files with 23 additions and 6 deletions
  1. +6
    -0
      php/ng/fpm/pools_config.sls
  2. +11
    -6
      php/ng/map.jinja
  3. +6
    -0
      pillar.example

+ 6
- 0
php/ng/fpm/pools_config.sls View File

{% set pool_states = [] %} {% set pool_states = [] %}


{% for pool, config in php.fpm.pools.iteritems() %} {% for pool, config in php.fpm.pools.iteritems() %}
{% if pool == 'defaults' %}{% continue %}{% endif %}
{% for pkey, pvalues in config.get('settings', {}).iteritems() %}
{% set pool_defaults = php.fpm.pools.get('defaults', {}).copy() %}
{% do pool_defaults.update(pvalues) %}
{% do pvalues.update(pool_defaults) %}
{% endfor %}
{% set state = 'php_fpm_pool_conf_' ~ loop.index0 %} {% set state = 'php_fpm_pool_conf_' ~ loop.index0 %}
{% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} {% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %}



+ 11
- 6
php/ng/map.jinja View File

{%- endif %} {%- endif %}
{%- elif salt['grains.get']('os') == "Debian" %} {%- elif salt['grains.get']('os') == "Debian" %}
{%- set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %} {%- set phpng_version = salt['pillar.get']('php:ng:version', '7.0')|string %}
{%- if phpng_version|string == '5' %}
{%- set confdir = '/etc/php5' %}
{%- else %}
{%- set confdir = '/etc/php/' + phpng_version %}
{%- endif %}
{%- set php = salt['pillar.get']('php:ng', { {%- set php = salt['pillar.get']('php:ng', {
'lookup': salt['grains.filter_by']({ 'lookup': salt['grains.filter_by']({
'Debian': { 'Debian': {
'zip': 'php' + phpng_version + '-zip', 'zip': 'php' + phpng_version + '-zip',
}, },
'fpm': { 'fpm': {
'conf': '/etc/php/' + phpng_version + '/fpm/php-fpm.conf',
'ini': '/etc/php/' + phpng_version + '/fpm/php.ini',
'pools': '/etc/php/' + phpng_version + '/fpm/pool.d',
'conf': confdir + '/fpm/php-fpm.conf',
'ini': confdir + '/fpm/php.ini',
'pools': confdir + '/fpm/pool.d',
'service': 'php' + phpng_version + '-fpm', 'service': 'php' + phpng_version + '-fpm',
'defaults': odict([ 'defaults': odict([
('global', odict([ ('global', odict([
('pid', '/var/run/php' + phpng_version + '-fpm.pid'), ('pid', '/var/run/php' + phpng_version + '-fpm.pid'),
('error_log', '/var/log/php' + phpng_version + '-fpm.log'), ('error_log', '/var/log/php' + phpng_version + '-fpm.log'),
])), ])),
('include', '/etc/php/' + phpng_version + '/fpm/pool.d/*.conf'),
('include', confdir + '/fpm/pool.d/*.conf'),
]), ]),
}, },
'hhvm': { 'hhvm': {
]), ]),
}, },
'cli': { 'cli': {
'ini': '/etc/php/' + phpng_version + '/cli/php.ini',
'ini': confdir + '/cli/php.ini',
}, },
'apache2': { 'apache2': {
'ini': '/etc/php/' + phpng_version + '/apache2/php.ini',
'ini': confdir + '/apache2/php.ini',
}, },
}, },
}), }),

+ 6
- 0
pillar.example View File



# settings for fpm-pools # settings for fpm-pools
pools: pools:
# defaults will apply for each pools settings and can be overwritten by pool settings
defaults:
user: nginx
group: nginx
listen: /var/run/php-fpm-default.sock

# name of the pool file to be managed, this will be appended # name of the pool file to be managed, this will be appended
# to the path specified in php.ng.lookup.fpm.pools # to the path specified in php.ng.lookup.fpm.pools
'mypool.conf': 'mypool.conf':

Loading…
Cancel
Save