-
Notifications
You must be signed in to change notification settings - Fork 113
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
[BUG] Unable to manage file: Jinja error: openvpn/macros.jinja using salt-ssh #147
Comments
Thanks for this report, @waynegemmell. This is strange, since we have the newest @baby-gnu Any ideas about what is happening here? |
Hello @myii and @waynegemmell. I just made a simple test:
salt-ssh --versions-report
I even try a salt-ssh 192.168.0.101 state.apply openvpn
I do not use the |
I've removed the extra-filerefs from my config and it's doing the same thing. Maybe it's a version issue? I'm trying to test on a lower version but not managing. |
I'll setup a 3003.3 on a VM to test. |
Any luck? |
Hello @waynegemmell On a VM with `3003.3`, it does not work with the following
On a VM with `3002.7`, it's working
So, something changed between |
Any idea @myii ? |
@waynegemmell Found this same regression hits the other formulas using the new - Rendering SLS 'base:openssh.config' failed: Jinja error: openssh/map.jinja
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 500, 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 2, in <module>
File "/usr/lib/python3/dist-packages/salt/utils/jinja.py", line 198, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: openssh/map.jinja
; line 2
---
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata with context %} <======================
{%- from tplroot ~ "/libtofs.jinja" import files_switch %}
{%- set openssh = mapdata.openssh %}
{%- set sshd_config = mapdata.sshd_config %}
{%- set ssh_config = mapdata.ssh_config %}
[...] And: - Rendering SLS 'base:TEMPLATE.package.install' failed: Jinja error: TEMPLATE/map.jinja
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/utils/templates.py", line 500, 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 6, in <module>
File "/usr/lib/python3/dist-packages/salt/utils/jinja.py", line 198, in get_source
raise TemplateNotFound(template)
jinja2.exceptions.TemplateNotFound: TEMPLATE/map.jinja
; line 6
---
# -*- coding: utf-8 -*-
# vim: ft=sls
{#- Get the `tplroot` from `tpldir` #}
{%- set tplroot = tpldir.split('/')[0] %}
{%- from tplroot ~ "/map.jinja" import mapdata as TEMPLATE with context %} <======================
TEMPLATE-package-install-pkg-installed:
pkg.installed:
- name: {{ TEMPLATE.pkg.name }}
[...] Following through from the issue the @baby-gnu has commented in above, it seems that a fix has just been merged that will be included in
I tried it out locally and it seems to work if I provide |
Thanks @myii, so I really don't understand why it's working with |
Thanks @myii, is that merged into master? |
@waynegemmell Yes and as I understand, it will be included in |
I did my tests again with several VMs trying to
|
I produce a minimalist setup to reproduce the problem in saltstack/salt#31531 (comment). |
Hello, saltstack/salt#61895 fixes my issues with either |
Your setup
Formula commit hash / release tag
I'm using HEAD on master
Versions reports (master & minion)
Sunning salt-ssh
Bug details
Describe the bug
The following error happens when trying to apply openvpn formula useing salt-ssh.
Unable to manage file: Jinja error: openvpn/macros.jinja
I have the following in my Saltfile which normally fixes the issue.
- salt://openvpn/macros.jinja
Here's the output
The text was updated successfully, but these errors were encountered: