debian-setup/templates/network/wg0.netdev.j2
sonny 16a979b04b Use preshared key inside configuration
File options do not seem to work
2021-12-29 12:00:02 +01:00

20 lines
428 B
Django/Jinja

# {{ ansible_managed }} {{ ansible_date_time.time }} {{ ansible_date_time.date }}
[NetDev]
Name={{ vpn_interface }}
Kind=wireguard
Description=WireGuard tunnel wg0
[WireGuard]
ListenPort={{ vpn_port }}
PrivateKey={{ vpn_server_key }}
{% for peer in vpn_peers %}
[WireGuardPeer]
PublicKey={{ peer.public_key }}
PresharedKey={{ peer.preshared_key }}
AllowedIPs={{ peer.ip }}/32
{% if not loop.last %}
{% endif %}
{% endfor %}