From 57127b31ce77d3dc2ea555c32a2e57de18158ffb Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Fri, 4 Nov 2022 17:58:18 +0200 Subject: [PATCH] find address in list of peers --- templates/wireguard_client.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }}