Infra/ansible/roles/cloud_key/templates/config.gateway.json.j2

12 lines
458 B
Plaintext
Raw Permalink Normal View History

2022-10-18 22:04:13 +02:00
{% set copy_=unifi_gateway_config -%}
{% for inf in unifi_gateway_config.interfaces.wireguard %}
{%- set p=[] -%}
{% for peer in unifi_gateway_config.interfaces.wireguard[inf].peer %}
{%- set m=peer.key -%}
{%- set x=peer.pop("key") -%}
{%- set x=(p.append({m: peer})) -%}
{% endfor %}
{%- set x=(unifi_gateway_config.interfaces.wireguard[inf].__setitem__("peer", p)) -%}
{% endfor %}
{{- copy_ | to_json(indent=4) }}