{% for device in groups['mesh_devices'] %} [Peer] # {{ hostvars[device].hostname }} PublicKey = {{ hostvars[device].vpn_wg0_publickey }} Endpoint = 0.0.0.0:51800 AllowedIPs = {{ vpn_wg0_network }}.{{ hostvars[device].ip_host }}/32 {% endfor %}