From 39a07225b70f710ee77ef649724c8f098f562fdb Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Sat, 28 Sep 2024 22:27:11 +0200 Subject: [PATCH] add timer options --- defaults/main.yml | 6 +++--- templates/etc/systemd/system/lego-renew.timer.j2 | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index f173e27..a8961f0 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -29,6 +29,6 @@ lego_key_type: "ec256" # @end lego_certificates: [] -lego_cron_enabled: True -lego_cron_minute: "0" -lego_cron_hour: "2" +lego_renew_enabled: True +lego_renew_interval: "*-*-* 1:35" +lego_renew_randomized_delay: "1h" diff --git a/templates/etc/systemd/system/lego-renew.timer.j2 b/templates/etc/systemd/system/lego-renew.timer.j2 index fbe547b..d2398c9 100644 --- a/templates/etc/systemd/system/lego-renew.timer.j2 +++ b/templates/etc/systemd/system/lego-renew.timer.j2 @@ -2,8 +2,9 @@ Description=Lego renew [Timer] -OnCalendar={{ lego_renew_interval }} Persistent=true +OnCalendar={{ lego_renew_interval }} +RandomizedDelaySec={{ lego_renew_randomized_delay }} [Install] WantedBy=timers.target