24 lines
521 B
Django/Jinja
24 lines
521 B
Django/Jinja
# {{ ansible_managed }}
|
|
|
|
[NetDev]
|
|
Name={{ vpn_default.interface }}
|
|
Kind=wireguard
|
|
Description=WireGuard tunnel {{ vpn_default.interface }}
|
|
|
|
[WireGuard]
|
|
PrivateKeyFile={{ vpn_default.private_key_path }}
|
|
|
|
{% for peer in vpn_default.peers %}
|
|
[WireGuardPeer]
|
|
PublicKey={{ peer.public_key }}
|
|
PresharedKeyFile={{ peer.preshared_key_path }}
|
|
{% for ip in peer.allowed_ips %}
|
|
AllowedIPs={{ ip.address }}
|
|
{% endfor %}
|
|
{% if peer.endpoint %}
|
|
Endpoint={{ peer.endpoint }}
|
|
{% endif %}
|
|
{% if not loop.last %}
|
|
|
|
{% endif %}
|
|
{% endfor %}
|