fix(pillar): fix pillar.get still looking under 'ng' namespace

This commit is contained in:
Nicolas Rodriguez 2019-08-27 00:05:26 +02:00
parent 2a353df5d9
commit 378b5b1d37
5 changed files with 23 additions and 23 deletions

View File

@ -11,10 +11,10 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} {% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} {% if pillar_php_version is iterable and pillar_php_version is not string %}
{% for version in pillar_php_ng_version %} {% for version in pillar_php_version %}
{% set first_version = pillar_php_ng_version[0]|string %} {% set first_version = pillar_php_version[0]|string %}
{% set ini = php.lookup.cli.ini|replace(first_version, version) %} {% set ini = php.lookup.cli.ini|replace(first_version, version) %}
php_cli_ini_{{ version }}: php_cli_ini_{{ version }}:
{{ php_ini(ini, php.cli.ini.opts, settings) }} {{ php_ini(ini, php.cli.ini.opts, settings) }}

View File

@ -11,11 +11,11 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} {% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} {% if pillar_php_version is iterable and pillar_php_version is not string %}
{% for version in pillar_php_ng_version %} {% for version in pillar_php_version %}
{% set conf_settings = odict(php.lookup.fpm.defaults) %} {% set conf_settings = odict(php.lookup.fpm.defaults) %}
{% set first_version = pillar_php_ng_version[0]|string %} {% set first_version = pillar_php_version[0]|string %}
{% set ini = php.lookup.fpm.ini|replace(first_version, version) %} {% set ini = php.lookup.fpm.ini|replace(first_version, version) %}
{% set conf = php.lookup.fpm.conf|replace(first_version, version) %} {% set conf = php.lookup.fpm.conf|replace(first_version, version) %}
{% set pools = php.lookup.fpm.pools|replace(first_version, version) %} {% set pools = php.lookup.fpm.pools|replace(first_version, version) %}

View File

@ -5,13 +5,13 @@ include:
- php.fpm.service - php.fpm.service
- php.fpm.pools - php.fpm.pools
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} {% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
extend: extend:
php_fpm_service: php_fpm_service:
service: service:
- watch: - watch:
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} {% if pillar_php_version is iterable and pillar_php_version is not string %}
{% for version in pillar_php_ng_version %} {% 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 %} {% endfor %}
@ -21,8 +21,8 @@ extend:
{% endif %} {% endif %}
- require: - require:
- sls: php.fpm.config - sls: php.fpm.config
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} {% if pillar_php_version is iterable and pillar_php_version is not string %}
{% for version in pillar_php_ng_version %} {% for version in pillar_php_version %}
php_fpm_ini_config_{{ version }}: php_fpm_ini_config_{{ version }}:
file: file:
- require: - require:

View File

@ -18,10 +18,10 @@
{% endfor %} {% endfor %}
{% set state = 'php_fpm_pool_conf_' ~ loop.index0 %} {% set state = 'php_fpm_pool_conf_' ~ loop.index0 %}
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} {% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} {% if pillar_php_version is iterable and pillar_php_version is not string %}
{% set first_fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} {% set first_fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %}
{% set first_version = pillar_php_ng_version[0]|string %} {% set first_version = pillar_php_version[0]|string %}
{% set fpath = first_fpath.replace(first_version, config.get('phpversion', '7.0')) %} {% set fpath = first_fpath.replace(first_version, config.get('phpversion', '7.0')) %}
{% else %} {% else %}
{% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %} {% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %}

View File

@ -9,16 +9,16 @@
{% set pkgs = [] %} {% set pkgs = [] %}
{% set specials = [] %} {% set specials = [] %}
{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %} {% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
{% if pkginfo is iterable and pkginfo is not string %} {% if pkginfo is iterable and pkginfo is not string %}
{% for pkg in pkginfo %} {% for pkg in pkginfo %}
{% if pkg is mapping %} {% if pkg is mapping %}
{% do specials.append(pkg) %} {% do specials.append(pkg) %}
{% else %} {% else %}
{% do pkgs.append(pkg) %} {% do pkgs.append(pkg) %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} {% if pillar_php_version is iterable and pillar_php_version is not string %}
{% set first_version = pillar_php_ng_version[0]|string %} {% set first_version = pillar_php_version[0]|string %}
{% for other_version in pillar_php_ng_version %} {% for other_version in pillar_php_version %}
{% set other_version_str = other_version|string %} {% set other_version_str = other_version|string %}
{% do pkgs.append(pkg.replace(first_version, other_version_str)) %} {% do pkgs.append(pkg.replace(first_version, other_version_str)) %}
{% endfor %} {% endfor %}
@ -27,9 +27,9 @@
{% endfor %} {% endfor %}
{% else %} {% else %}
{% do pkgs.append(pkginfo) %} {% do pkgs.append(pkginfo) %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %} {% if pillar_php_version is iterable and pillar_php_version is not string %}
{% set first_version = pillar_php_ng_version[0]|string %} {% set first_version = pillar_php_version[0]|string %}
{% for other_version in pillar_php_ng_version %} {% for other_version in pillar_php_version %}
{% set other_version_str = other_version|string %} {% set other_version_str = other_version|string %}
{% do pkgs.append(pkginfo.replace(first_version, other_version_str)) %} {% do pkgs.append(pkginfo.replace(first_version, other_version_str)) %}
{% endfor %} {% endfor %}