From 038f19ea5e79ab2d6632c6208efada011c998e12 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sun, 11 Sep 2022 11:32:26 +0200 Subject: [PATCH] bundles/unbound: use systemd-timers --- bundles/unbound/metadata.py | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/bundles/unbound/metadata.py b/bundles/unbound/metadata.py index f8724c4..b08df0b 100644 --- a/bundles/unbound/metadata.py +++ b/bundles/unbound/metadata.py @@ -7,19 +7,24 @@ defaults = { 'unbound-anchor': {}, }, }, - 'cron': { - 'jobs': { - 'unbound_refresh_root-hints': '{} {} * * {} root wget -q -O/etc/unbound/root-hints.txt https://www.internic.net/domain/named.root'.format( - node.magic_number%60, - node.magic_number%24, - node.magic_number%7, - ), - 'unbound-auto-restart': '* * * * * root /usr/local/sbin/unbound-auto-restart', - }, - }, 'nameservers': { '127.0.0.1', }, + 'systemd-timers': { + 'timers': { + 'unbound-refresh-root-hints': { + 'command': 'wget -q -O/etc/unbound/root-hints.txt https://www.internic.net/domain/named.root', + 'when': '{}:{}:00'.format( + node.magic_number % 24, + node.magic_number % 60, + ), + }, + 'unbound-auto-restart': { + 'command': '/usr/local/sbin/unbound-auto-restart', + 'when': 'minutely', + }, + }, + }, 'unbound': { 'max_ttl': 3600, 'cache_size': '512M',