Last active
June 6, 2019 07:44
-
-
Save dschier-wtd/b47aa0d4360b0c0db5d23076b918e562 to your computer and use it in GitHub Desktop.
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
# defaults/main.yml | |
config: | |
- name: alice | |
execStart: alice.sh | |
retains: | |
- name: blub | |
time: 12:00 | |
value: 5 | |
- name: blib | |
value: 6 | |
# tasks/main.yml | |
- name: Loop all exec | |
template: | |
src: foo.j2 | |
dest: "{{ item.name }}" | |
loop: "{{ config }}" | |
# templates/foo.j2 | |
exec = {{ item.execStart }} | |
{% for i in item.retains %} | |
{{ i.name }} {{ i.time|default('00:00') }} {{ i.value }} | |
{% endfor %} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment