Skip to content
Snippets Groups Projects
Commit a2e45f74 authored by Dirk Sarpe's avatar Dirk Sarpe
Browse files

initial commit

parents
Branches main
No related tags found
No related merge requests found
---
dictofdicts:
a:
foo: 1
bar: 2
b:
foo: 2
bar: 2
baz: c
listofdicts:
- name: a
foo: 1
bar: 2
- name: b
foo: 2
bar: 2
baz: c
...
---
- name: template dictofdicts
template:
src: dictator.j2
dest: dictator
- name: template listofdicts
template:
src: listator.j2
dest: listator
...
{% for dict_name, dict in dictofdicts.iteritems() %}
[{{ dict_name }}]
{% for item in dict | dict2items %}
{{ item.key }}={{ item.value }}
{% endfor %}
{% endfor %}
{% for dict in listofdicts %}
[{{ dict.name }}]
{% for item in dict | dict2items %}
{% if item.key != 'name' %}
{{ item.key }}={{ item.value }}
{% endif %}
{% endfor %}
{% endfor %}
- hosts: localhost
gather_facts: false
roles:
- role: ../style_question
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment