You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# salt-minion --versions-report
Salt Version:
Salt: 3000.3
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
Jinja2: 2.10
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 3.7.3 (default, Apr 3 2019, 05:39:12)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 17.1.2
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.1
System Versions:
dist: debian 10.1
locale: UTF-8
machine: x86_64
release: 4.19.0-6-amd64
system: Linux
version: debian 10.1
master:
# salt-master --versions-report
Salt Version:
Salt: 3000.3
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: 2.0.5
gitpython: 2.1.11
Jinja2: 2.10
libgit2: 0.27.7
M2Crypto: Not Installed
Mako: 1.1.2
msgpack-pure: Not Installed
msgpack-python: 0.5.6
mysql-python: 1.3.10
pycparser: 2.19
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: 0.27.4
Python: 3.7.3 (default, Apr 3 2019, 05:39:12)
python-gnupg: Not Installed
PyYAML: 3.13
PyZMQ: 17.1.2
smmap: 2.0.5
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.1
System Versions:
dist: debian 10.1
locale: UTF-8
machine: x86_64
release: 4.19.0-6-amd64
system: Linux
version: debian 10.1
Bug details
Describe the bug
salt-call state.sls nginx.servers fails with the following error.
local:
Data failed to compile:
----------
Rendering SLS 'base:nginx.servers' failed: Jinja variable the template u'nginx/service.sls' (imported on line 8) does not export the requested name 'service_function'
Attempts to fix the bug
Setting service_function in servers.sls directly without importing it, works as expected.
diff --git a/nginx/servers.sls b/nginx/servers.sls
index f3033bb..3dc517d 100644
--- a/nginx/servers.sls
+++ b/nginx/servers.sls
@@ -5,7 +5,8 @@
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ '/map.jinja' import nginx, sls_block with context %}
{%- from tplroot ~ '/servers_config.sls' import server_states with context %}
-{%- from tplroot ~ '/service.sls' import service_function with context %}
+
+{% set service_function = {True:'running', False:'dead'}.get(nginx.service.enable) %}
{% macro file_requisites(states) %}
{%- for state in states %}
Additional context
The text was updated successfully, but these errors were encountered:
can you give use more information about how you tested or find this problem?
I just tried using the docker image default-debian-10-master-py3 which is a Debian 10 with version 3000-n/a-99ffbf1 of salt and:
kitchen converge works
inside the image, salt-call --local --config-dir=/tmp/kitchen/etc/salt state.sls nginx.servers works too
Your setup
Formula commit hash / release tag
Commit Hash: a288342
Versions reports (master & minion)
minion:
master:
Bug details
Describe the bug
salt-call state.sls nginx.servers
fails with the following error.Attempts to fix the bug
Setting service_function in servers.sls directly without importing it, works as expected.
Additional context
The text was updated successfully, but these errors were encountered: