Explorar el Código

simplify and fix wg.conf output() macros

tags/v2.1^0
Maximilian Eschenbacher hace 5 años
padre
commit
be1f11f32f
Se han modificado 1 ficheros con 3 adiciones y 8 borrados
  1. +3
    -8
      wireguard/files/wg.conf

+ 3
- 8
wireguard/files/wg.conf Ver fichero

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

Cargando…
Cancelar
Guardar