It's really hard to deal with magically converting from Jinja strings back into native python types. Let's just skip the conversion and use native python types.
How you ask? Jinja has merged a pretty cool PR: pallets/jinja#708
Here's a quote from the new doc:
The default jinja2.Environment renders templates to strings. With NativeEnvironment, rendering a template produces a native Python type.
This consists of three basic parts: NativeCodeGenerator, NativeTemplate, and NativeEnvironment. Check out the code. This will land in Jinja 2.10.
This comes from an ansible PR by @jctanner: ansible/ansible#23943
I suspect that using NativeEnvironment would resolve (or make a big dent in) these:
It's really hard to deal with magically converting from Jinja strings back into native python types. Let's just skip the conversion and use native python types.
How you ask? Jinja has merged a pretty cool PR: pallets/jinja#708
Here's a quote from the new doc:
This consists of three basic parts:
NativeCodeGenerator,NativeTemplate, andNativeEnvironment. Check out the code. This will land in Jinja 2.10.This comes from an ansible PR by @jctanner: ansible/ansible#23943
I suspect that using
NativeEnvironmentwould resolve (or make a big dent in) these: