Browse Source

wg.conf: do not output list keys if they are a string

tags/v2.0
Maximilian Eschenbacher 5 years ago
parent
commit
659aae2bed
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      wireguard/files/wg.conf

+ 5
- 2
wireguard/files/wg.conf View File

@@ -4,9 +4,12 @@
{%- endif -%}
{%- endmacro -%}
{%- macro output_list_if_set(object, lookup_key, output_key) -%}
{%- for item in object.get(lookup_key, []) -%}
{%- set l = object.get(lookup_key, []) -%}
{%- if l is not string -%}
{%- for item in l -%}
{{output_key}} = {{item}}
{%- endfor -%}
{%- endfor -%}
{%- endif -%}
{%- endmacro -%}
[Interface]
{{ output_list_if_set(interface, 'address', 'Address') }}

Loading…
Cancel
Save