-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Jinja import: Jinja variable 'salt' is undefined #10206
Comments
I'm guessing this has something to do with the way that we're injecting those salt-specific variables into the template context. I'm unsure of what it will take (or if it's possible) to inject them into includes as well, but we'll definitely look into it! |
i thinked i may have fixed that via #10307 |
Thank you! For now I can't check this, but I will try later. |
Seems like this patch #10307 is not working for my bug (tested on 2014.1.0 release) |
FWIW, this is still an issue on 2014.1.3 (via PPA). One (cheap) workaround is to wrap the included template in a macro and pass |
Ah, thanks, should've realized. Went to test and realized that this was a silly oversight on my part (I forgot to re-add a |
Wow, seems like it's works with {% import 'openssl/vars.sls' as ssl with context %} in version 2013.1.1 without patches )) |
Oh good call! I forgot about |
Removes the "Full list of builtin ..." from each module reference list, leaving just the module type for scanability. Refs saltstack#12470 Refs saltstack#10206 Refs saltstack#10480 Refs saltstack#23522 Refs saltstack#33023
I've added the note about 'with context' at https://docs.saltstack.com/en/latest/topics/jinja/index.html#including-context-during-include-import @rabits if you think this fix is sufficient please close. Thanks. |
Thank you) Totally forgot about closing |
Description:
I can't import an jinja template that uses predefined variables (like
salt
,pillar
,grains
etc) into another template.Example:
Thanks
The text was updated successfully, but these errors were encountered: