[NetDev] Name=wg0 Kind=wireguard Description=Wireguard tunnel wg0 [WireGuard] ListenPort=51820 PrivateKey={{ wireguard_private_key.stdout }} {% for peer in groups['wireguard'] %} {% if peer != inventory_hostname %} [WireGuardPeer] PublicKey={{ hostvars[peer].wireguard_public_key.stdout }} AllowedIPs={{ hostvars[peer].wireguard_ip }}/32 PersistentKeepalive=25 {% endif %} {% endfor %} # ouroboros [WireGuardPeer] PublicKey={{ ouroboros_wireguard_public_key }} AllowedIPs={{ ouroboros_wireguard_ip }}/32 PersistentKeepalive=25 # mobile [WireGuardPeer] PublicKey={{ mobile_wireguard_public_key }} AllowedIPs={{ mobile_wireguard_ip }}/32 PersistentKeepalive=25