Created
February 12, 2025 10:05
-
-
Save oharsta/42306e889b41f1de5cfda262da48099f to your computer and use it in GitHub Desktop.
Testing ansible templates in python
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 jinja2 import Template | |
template = Template(""" | |
{% for lang in my_var.split(',') %} | |
Language: {{ lang }} | |
{% endfor %} | |
""") | |
output = template.render(my_var="en,nl") | |
print(output) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment