[Interface] Address = {{ wg_nodes[inventory_hostname].address }}/24 ListenPort = {{ wg_port }} PrivateKey = {{ wg_private_key }} {% for h in groups['k8s_nodes'] if h != inventory_hostname %} [Peer] PublicKey = {{ hostvars[h].wg_public_key }} AllowedIPs = {{ wg_nodes[h].address }}/32 Endpoint = {{ wg_nodes[h].public_ip }}:{{ wg_port }} PersistentKeepalive = 25 {% endfor %}