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
Description
When attempting to use the consul-formula formula via GitFS, the following error occurs:
Data failed to compile:
----------
Rendering SLS 'staging:formulas.consul.consul' failed: Jinja error: formulas/map.jinja
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 400, in render_jinja_tmpl
output = template.render(**decoded_context)
File "/usr/lib/python3/dist-packages/jinja2/asyncsupport.py", line 76, in render
return original_render(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 1008, in render
return self.environment.handle_exception(exc_info, True)
File "/usr/lib/python3/dist-packages/jinja2/environment.py", line 780, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/lib/python3/dist-packages/jinja2/_compat.py", line 37, in reraise
raise value.with_traceback(tb)
File "<template>", line 3, in <module>
File "/usr/lib/python3/dist-packages/salt/utils/jinja.py", line 204, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: formulas/map.jinja
; line 3
---
{%- set tplroot = tpldir.split('/')[0] %}
{%- if pillar.get('consul', {}).get('enabled', True) %}
{% from tplroot+"/map.jinja" import consul with context %} <======================
My suspicion is that there is no way to accomplish what I desire: formulas mounted in arbitrary directories.
@centromere Your suspicion is correct. We haven't figured out a single method to cater for all situations, to make formulas completely portable. This whole issue goes into more detail but I'm linking to my comment there which gives a summary of where we're up to:
Description
When attempting to use the consul-formula formula via GitFS, the following error occurs:
Setup
salt-master config:
top.sls
:Steps to Reproduce the behavior
state.apply
.Expected behavior
The state is applied successfully.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)The text was updated successfully, but these errors were encountered: