diff --git a/templates/wireguard_client.conf b/templates/wireguard_client.conf index 57d5703..9b2d523 100644 --- a/templates/wireguard_client.conf +++ b/templates/wireguard_client.conf @@ -1,5 +1,5 @@ [Interface] -Address = {{ addresses[ansible_hostname] }} +Address = {% for item in wireguard_peers %}{% if item['name'] == ansible_hostname %}}{{ item['AllowedIPs'] }}{% endif %}{% endfor %} PrivateKey = {{ private_key }} ListenPort = {{ listenport }}