try to parse lists and dicts from config
This commit is contained in:
parent
28098d3474
commit
f8375f323c
1 changed files with 15 additions and 1 deletions
|
|
@ -1,4 +1,18 @@
|
|||
{%- macro keyvalue(key, value, depth=0) -%}
|
||||
{%- if value is string -%}
|
||||
{{ key }}="{{ value }}";
|
||||
{%- elif value is mapping %}
|
||||
{{ key }} {
|
||||
{% for key, value in value.items() %}
|
||||
{{ keyvalue(key, value) }}
|
||||
{% endfor %}
|
||||
}
|
||||
{% elif value is iterable and (value is not string and value is not mapping) -%}
|
||||
{{ key }}=["{{ value|join('", "') }}"];
|
||||
{%- endif -%}
|
||||
{%- endmacro -%}
|
||||
|
||||
# {{ ansible_managed }}
|
||||
{% for key, value in item.value.items() %}
|
||||
{{ key }}="{{ value }}";
|
||||
{{ keyvalue(key, value) }}
|
||||
{% endfor %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue