Bladeren bron

simplify and fix wg.conf output() macros

tags/v2.1^0
Maximilian Eschenbacher 5 jaren geleden
bovenliggende
commit
be1f11f32f
1 gewijzigde bestanden met toevoegingen van 3 en 8 verwijderingen
  1. +3
    -8
      wireguard/files/wg.conf

+ 3
- 8
wireguard/files/wg.conf Bestand weergeven

@@ -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]

Laden…
Annuleren
Opslaan