Last active
March 6, 2020 13:07
-
-
Save heiwa4126/a51894a7124b043258aecb515b6918c5 to your computer and use it in GitHub Desktop.
Ansibleのサンプル。Jnija2には内包表記がない。リストを「引用符でくくって、コンマでつなぐ」例。win_shellとかでよく使う。
This file contains 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
- name: jinja2 has not list comprehension. | |
hosts: localhost | |
become: no | |
gather_facts: false | |
vars: | |
data: [foo, bar, baz] | |
tasks: | |
- | |
debug: | |
msg: > | |
{% for x in data %}"{{x}}"{% if loop.last %}{% else %},{% endif %}{% endfor %} |
Author
heiwa4126
commented
Mar 6, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment