From d898f41064b315bd4cc20a14893d3b40589b103c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jagoda=20Estera=20=C5=9Al=C4=85zak?= <128227338+j-g00da@users.noreply.github.com> Date: Tue, 2 Jun 2026 19:02:07 +0900 Subject: [PATCH] fix: Always deploy unbound.conf.d/chatmail.conf (#993) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes issue with negative cache only disabled in ipv4-only mode. Follow up to #992 Signed-off-by: Jagoda Ślązak --- cmdeploy/src/cmdeploy/deployers.py | 18 ++++++++---------- cmdeploy/src/cmdeploy/unbound/unbound.conf.j2 | 2 ++ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/cmdeploy/src/cmdeploy/deployers.py b/cmdeploy/src/cmdeploy/deployers.py index 9a8276a1..88fdfd48 100644 --- a/cmdeploy/src/cmdeploy/deployers.py +++ b/cmdeploy/src/cmdeploy/deployers.py @@ -171,16 +171,14 @@ class UnboundDeployer(Deployer): "unbound-anchor -a /var/lib/unbound/root.key || true", ], ) - if self.config.disable_ipv6: - self.ensure_directory( - path="/etc/unbound/unbound.conf.d", - ) - self.put_template( - "unbound/unbound.conf.j2", - "/etc/unbound/unbound.conf.d/chatmail.conf", - ) - else: - self.remove_file("/etc/unbound/unbound.conf.d/chatmail.conf") + self.ensure_directory( + path="/etc/unbound/unbound.conf.d", + ) + self.put_template( + "unbound/unbound.conf.j2", + "/etc/unbound/unbound.conf.d/chatmail.conf", + disable_ipv6=self.config.disable_ipv6, + ) def activate(self): server.shell( diff --git a/cmdeploy/src/cmdeploy/unbound/unbound.conf.j2 b/cmdeploy/src/cmdeploy/unbound/unbound.conf.j2 index 98766e3b..faa7cd49 100644 --- a/cmdeploy/src/cmdeploy/unbound/unbound.conf.j2 +++ b/cmdeploy/src/cmdeploy/unbound/unbound.conf.j2 @@ -1,5 +1,7 @@ # Managed by cmdeploy server: +{% if disable_ipv6 %} interface: 127.0.0.1 do-ip6: no +{% endif %} cache-max-negative-ttl: 0