Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions php/cli/ini.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
{% endif %}
{% endfor %}

{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
{% for version in pillar_php_ng_version %}
{% set first_version = pillar_php_ng_version[0]|string %}
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
{% if pillar_php_version is iterable and pillar_php_version is not string %}
{% for version in pillar_php_version %}
{% set first_version = pillar_php_version[0]|string %}
{% set ini = php.lookup.cli.ini|replace(first_version, version) %}
php_cli_ini_{{ version }}:
{{ php_ini(ini, php.cli.ini.opts, settings) }}
Expand Down
8 changes: 4 additions & 4 deletions php/fpm/config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
{% endif %}
{% endfor %}

{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
{% for version in pillar_php_ng_version %}
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
{% if pillar_php_version is iterable and pillar_php_version is not string %}
{% for version in pillar_php_version %}
{% 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 conf = php.lookup.fpm.conf|replace(first_version, version) %}
{% set pools = php.lookup.fpm.pools|replace(first_version, version) %}
Expand Down
10 changes: 5 additions & 5 deletions php/fpm/init.sls
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ include:
- php.fpm.service
- 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:
php_fpm_service:
service:
- watch:
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
{% for version in pillar_php_ng_version %}
{% 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_conf_config_{{ version }}
{% endfor %}
Expand All @@ -21,8 +21,8 @@ extend:
{% endif %}
- require:
- sls: php.fpm.config
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
{% for version in pillar_php_ng_version %}
{% if pillar_php_version is iterable and pillar_php_version is not string %}
{% for version in pillar_php_version %}
php_fpm_ini_config_{{ version }}:
file:
- require:
Expand Down
6 changes: 3 additions & 3 deletions php/fpm/pools_config.sls
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
{% endfor %}
{% set state = 'php_fpm_pool_conf_' ~ loop.index0 %}

{% set pillar_php_ng_version = salt['pillar.get']('php:ng:version', '7.0') %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %}
{% 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_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')) %}
{% else %}
{% set fpath = path_join(config.get('filename', pool), php.lookup.fpm.pools) %}
Expand Down
14 changes: 7 additions & 7 deletions php/installed.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@
{% set pkgs = [] %}
{% 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 %}
{% for pkg in pkginfo %}
{% if pkg is mapping %}
{% do specials.append(pkg) %}
{% else %}
{% do pkgs.append(pkg) %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
{% set first_version = pillar_php_ng_version[0]|string %}
{% for other_version in pillar_php_ng_version %}
{% if pillar_php_version is iterable and pillar_php_version is not string %}
{% set first_version = pillar_php_version[0]|string %}
{% for other_version in pillar_php_version %}
{% set other_version_str = other_version|string %}
{% do pkgs.append(pkg.replace(first_version, other_version_str)) %}
{% endfor %}
Expand All @@ -27,9 +27,9 @@
{% endfor %}
{% else %}
{% do pkgs.append(pkginfo) %}
{% if pillar_php_ng_version is iterable and pillar_php_ng_version is not string %}
{% set first_version = pillar_php_ng_version[0]|string %}
{% for other_version in pillar_php_ng_version %}
{% if pillar_php_version is iterable and pillar_php_version is not string %}
{% set first_version = pillar_php_version[0]|string %}
{% for other_version in pillar_php_version %}
{% set other_version_str = other_version|string %}
{% do pkgs.append(pkginfo.replace(first_version, other_version_str)) %}
{% endfor %}
Expand Down