{# Copyright (C) 2018 Maciej Delmanowski <drybjed@gmail.com>
 # Copyright (C) 2018 DebOps <https://debops.org/>
 # SPDX-License-Identifier: GPL-3.0-only
 #}
{% for element in item.config | parse_kv_items %}
{%   if element.state|d("present") not in [ "absent", "ignore", "init" ] %}
{%     if not loop.first %}

{%     endif %}
{{ '[{}]'.format(element.name) }}
{%     if element.options|d() %}
{%       for thing in element.options %}
{%         if thing.state|d("present") not in [ "absent", "ignore", "init" ] %}
{{ '{} = "{}"'.format(thing.name, thing.value) }}
{%         endif %}
{%       endfor %}
{%     endif %}
{%   endif %}
{% endfor %}
