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