Created
December 14, 2020 16:37
-
-
Save zeitounator/c7d4c62c5cd18f80600e5b85ae9602e4 to your computer and use it in GitHub Desktop.
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
name = {{ item.name }} | |
username = {{ item.username }} |
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
--- | |
- name: Create my files | |
hosts: localhost | |
gather_facts: false | |
vars: | |
jinja_var: | |
- name: a | |
username: c | |
- name: b | |
username: d | |
tasks: | |
- name: Create file from jinja | |
template: | |
src: "jinja.j2" | |
dest: "template_{{ item.name }}" | |
owner: "root" | |
group: "root" | |
with_items: "{{ jinja_var }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment