-
-
Save jblac/4c83b3d5b308f32031a99f9f493f4a36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% set environments = salt['pillar.get']('php:environments', {}).items() %} | |
{% set processed_environments = [] %} | |
{% for env_name, env_val in environments %} | |
{% do processed_environments.append('env['~ env_name ~'] = ' ~ env_val) %} | |
{% endfor %} | |
install_www_conf: | |
file.managed: | |
- name: /etc/php/7.0/fpm/pool.d/www.conf | |
- source: salt://php/files/pool_www.jinja | |
- template: jinja | |
- defaults: | |
environments: {{ processed_environments }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
php: | |
environment: | |
ENV_VAR_1: test | |
ENV_VAR_2: test2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from minion: | |
sudo salt-call state.apply php.env | |
[INFO ] Loading fresh modules for state activity | |
[CRITICAL] Rendering SLS 'base:php.env' failed: while parsing a flow sequence | |
in "<string>", line 9, column 21: | |
environments: [u'env[ENV_VAR_1] = asdd ... | |
^ | |
expected ',' or ']', but got '[' | |
in "<string>", line 9, column 27: | |
environments: [u'env[ENV_VAR_1] = asddddddd ... | |
^ | |
local: | |
Data failed to compile: | |
---------- | |
Rendering SLS 'base:php.env' failed: while parsing a flow sequence | |
in "<string>", line 9, column 21: | |
environments: [u'env[ENV_VAR_1] = asdd ... | |
^ | |
expected ',' or ']', but got '[' | |
in "<string>", line 9, column 27: | |
environments: [u'env[ENV_VAR_1] = asddddddd ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment