Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Say I have a Python function 'token_get' that encapsulates some heavy logic
- # and obtains token string required for the particular Pillar file.
- # Is it possible to call this function from Jinja template (Variant 1),
- # or should I wrap this function into a distinct binary ('token_get_binary')
- # and call it like in Variant 2?
- # Variant 1 (More preferred)
- config:
- host: abc.def.com
- port: 8081
- token: {{ token_get(arg1, arg2) }}
- # Variant 2 (Less preffered)
- config:
- host: abc.def.com
- port: 8081
- {% set token_get_cmd = ["token_get_binary", arg1, arg2] | join " " %}
- token: {{ salt['cmd.run'](token_get_cmd) }}
Add Comment
Please, Sign In to add comment