arch-setup/templates/xps/network/wg1.netdev.j2
Sonny Bakker 970f7489fb Layout refactor
Also included provisioning for htpc host
2025-10-12 15:33:37 +02:00

25 lines
521 B
Django/Jinja

# {{ ansible_managed }}
[NetDev]
Name={{ wireguard.interface }}
Kind=wireguard
Description=WireGuard tunnel {{ wireguard.interface }}
[WireGuard]
PrivateKeyFile={{ wireguard.private_key_path }}
RouteTable=main
{% for peer in wireguard.peers %}
[WireGuardPeer]
PublicKey={{ peer.public_key }}
PresharedKeyFile={{ peer.preshared_key_path }}
{% for ip in peer.allowed_ips %}
AllowedIPs={{ ip }}
{% endfor %}
{% if peer.endpoint %}
Endpoint={{ peer.endpoint }}
{% endif %}
{% if not loop.last %}
{% endif %}
{% endfor %}