diff --git a/cmdeploy/src/cmdeploy/deployers.py b/cmdeploy/src/cmdeploy/deployers.py index c69c7174..de110036 100644 --- a/cmdeploy/src/cmdeploy/deployers.py +++ b/cmdeploy/src/cmdeploy/deployers.py @@ -138,9 +138,22 @@ class UnboundDeployer(Deployer): # On an IPv4-only system, if unbound is started but not configured, # it causes subsequent steps to fail to resolve hosts. with blocked_service_startup(): + # dns-root-data is an optional package + # that contains /usr/share/dns/root.key + # + # This file is copied into /var/lib/unbound/root.key + # at the start of "unbound" systemd unit + # by /usr/libexec/unbound-helper shell script + # from the "unbound" package as of version 1.17.1-2+deb12u4 + # + # The same /var/lib/unbound/root.key can be retrieved directly + # following the procedure from + # + # with "unbound-anchor -a /var/lib/unbound/root.key" + # We don't install and use "unbound-anchor". apt.packages( name="Install unbound", - packages=["unbound", "unbound-anchor", "dnsutils"], + packages=["unbound", "dns-root-data", "dnsutils"], ) def configure(self): @@ -166,12 +179,6 @@ class UnboundDeployer(Deployer): dest="/etc/resolv.conf", force=True, ) - server.shell( - name="Generate root keys for validating DNSSEC", - commands=[ - "unbound-anchor -a /var/lib/unbound/root.key || true", - ], - ) self.ensure_directory( path="/etc/unbound/unbound.conf.d", ) @@ -246,6 +253,13 @@ class LegacyRemoveDeployer(Deployer): def install(self): apt.packages(name="Remove rspamd", packages="rspamd", present=False) + # unbound-anchor was used to download /var/lib/unbound/root.key + # It is replaced by dns-root-data which contains /usr/share/dns/root.key. + # unbound systemd unit copies /usr/share/dns/root.key + # into /var/lib/unbound/root.key automatically on start + # as long as /usr/share/dns/root.key is present. + apt.packages(name="Remove unbound-anchor", packages="unbound-anchor", present=False) + # remove historic expunge script # which is now implemented through a systemd timer (chatmail-expire) self.remove_file("/etc/cron.d/expunge")