From fc2eea9d9b1716b9ba2e4f586ac9ae32be1ff805 Mon Sep 17 00:00:00 2001 From: Rene Mewissen Date: Wed, 10 Aug 2022 10:44:32 +0200 Subject: [PATCH] use local address if no wg address is set --- roles/nameserver/templates/unbound_network.conf.j2 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/roles/nameserver/templates/unbound_network.conf.j2 b/roles/nameserver/templates/unbound_network.conf.j2 index 0681c6b..9ffcdc4 100644 --- a/roles/nameserver/templates/unbound_network.conf.j2 +++ b/roles/nameserver/templates/unbound_network.conf.j2 @@ -1,6 +1,10 @@ server: ip-freebind: yes + {% if wg_local_ip %} interface: {{ wg_local_ip | ipaddr('address') }} + {% else %} + interface: {{ ansible_default_ipv4.address }} + {% endif %} interface: 127.0.0.1 interface: 127.0.0.53 interface: ::1