# {{ ansible_managed }} [NetDev] Name={{ vpn_media_interface }} Kind=wireguard Description=WireGuard tunnel wg1 [WireGuard] ListenPort={{ vpn_media_port }} PrivateKey={{ vpn_media_server_key }} {% for peer, properties in vpn_media_peers.items() %} [WireGuardPeer] PublicKey={{ properties.public_key }} PresharedKey={{ properties.preshared_key }} AllowedIPs={{ properties.ip }}/32 {% if not loop.last %} {% endif %} {% endfor %}