Skip to content
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

Add extra_vars parsing directives due to Jinja #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cognifloyd
Copy link
Member

Jinja always casts extra_vars to string because it is impossible to
specify in a schema what vars might pass through extra_vars. So, to make
it possible to pass objects through Jinja and have them show up as
objects or ints or whatever, this adds directives with tests to show
they work.

The directives available are: '!INT', '!JSON', '!AST'. See the readme
for how to use them.

@cognifloyd
Copy link
Member Author

I tried adding jinja2 filters, but that didn't help. In order to solve this in a more generic way, ST2 would need something similar to allow for type specification on the fly so that it can cast things to the appropriate type.

Note that both this and #11 specify version 0.6.0. Whichever merges second will have to change to 0.7.0.

Jinja always casts extra_vars to string because it is impossible to
specify in a schema what vars might pass through extra_vars. So, to make
it possible to pass objects through Jinja and have them show up as
objects or ints or whatever, this adds directives with tests to show
they work.

The directives available are: '!INT', '!JSON', '!AST'. See the readme
for how to use them.
CHANGES.md Outdated Show resolved Hide resolved
@CLAassistant
Copy link

CLAassistant commented May 11, 2022

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants