Last active
April 7, 2016 17:47
-
-
Save gladiatr72/8552f9048f37485de05cce8e4914d89c to your computer and use it in GitHub Desktop.
reading a saltstack jinja template
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
some_variable = {{some_variable}} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from salt.utils.templates import JINJA | |
from salt.conf import minion_config | |
__opts__ = minion_config('/etc/salt/minion') | |
full_path='/var/tmp/jinja_test.sls' | |
ctx = { | |
'opts': __opts__, | |
'saltenv': 'base', | |
'some_variable': 'things and such' | |
} | |
R = JINJA(full_path, to_str=True, **ctx)['data'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment