ansible-role-certbot
ansible-role-certbot copied to clipboard
Why add cron if there's systemd timer
Hi isn't the cron setup redundant?
The certbot installed systemd timer that takes care of cert renewal
# systemctl status certbot.timer
● certbot.timer - Run certbot twice daily
Loaded: loaded (/lib/systemd/system/certbot.timer; enabled; preset: enabled)
Active: active (waiting) since Sun 2025-04-20 11:40:13 UTC; 23h ago
Trigger: Mon 2025-04-21 19:36:11 UTC; 8h left
Triggers: ● certbot.service
Apr 20 11:40:13 debian-bullseye-template systemd[1]: Started certbot.timer - Run certbot twice daily.
I think you can set certbot_auto_renew to disable the cron stuff. I don't know if every certbot installation method provides a systemd timer. Personally I prefer to use the systemd timer, too.
This unfortunately depends on the system. Example: Installing certbot from conda will not provide a systemd service.
Also, configuring renewal parameters would need an alternative solution if we do not use cron jobs...
would it make sense to provide a systemd service + timer directly as part of this role?
I've accounted for that in my fork and disabled the builtin systemd timers if certbot_auto_renew: true is set and certbot is running on either debian/ubuntu or rhel-derivates.
If more tweaks are needed - PRs welcome.