@@ -1,17 +1,12 @@ | |||
{%- macro output(key, value) -%} | |||
{%- if key in ['Address', 'DNS', 'AllowedIPs'] -%} | |||
{{output_list(key, value)}} | |||
{%- else -%} | |||
{{key}} = {{value}} | |||
{%- endif -%} | |||
{%- endmacro -%} | |||
{%- macro output_list(key, value) -%} | |||
{%- if value is string -%} | |||
{{key}} = {{value}} | |||
{%- else -%} | |||
{%- elif value is iterable -%} | |||
{%- for item in value %} | |||
{{key}} = {{item}} | |||
{%- endfor -%} | |||
{%- else -%} | |||
{{key}} = {{value}} | |||
{%- endif -%} | |||
{%- endmacro -%} | |||
[Interface] |