DNS: add 9.9.9.9 to resolv.conf if unbound isn't there yet

This commit is contained in:
missytake
2025-03-11 11:59:26 +01:00
committed by holger krekel
parent 71160b8f65
commit 44ff6da5d2
2 changed files with 9 additions and 0 deletions

View File

@@ -592,6 +592,12 @@ def deploy_chatmail(config_path: Path, disable_mail: bool) -> None:
ensure_newline=True,
)
if host.get_fact(Port, port=53) != "unbound":
files.line(
name="Add 9.9.9.9 to resolv.conf",
path="/etc/resolv.conf",
line="nameserver 9.9.9.9",
)
apt.update(name="apt update", cache_time=24 * 3600)
apt.upgrade(name="upgrade apt packages", auto_remove=True)