Optimized randomized_delay_sec, persistend & on_calendar for systemd-timer

This commit is contained in:
2023-04-16 10:33:21 +02:00
parent 01231cab6b
commit 0591f927ec
15 changed files with 45 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
- name: "restart certbot service"
- name: "reload certbot service"
systemd:
name: certbot.service
state: restarted
state: reloaded
enabled: yes
daemon_reload: yes
- name: "restart certbot timer"

View File

@@ -2,12 +2,15 @@
pacman:
name: [certbot,certbot-nginx]
state: present
notify: restart certbot service
- name: configure certbot.service.tpl
template: src=certbot.service dest=/etc/systemd/system/certbot.service
notify: restart certbot service
template:
src: certbot.service.j2
dest: /etc/systemd/system/certbot.service
notify: reload certbot service
- name: configure certbot.timer.tpl
template: src=certbot.timer dest=/etc/systemd/system/certbot.timer
template:
src: certbot.timer.j2
dest: /etc/systemd/system/certbot.timer
notify: restart certbot timer

View File

@@ -1,10 +0,0 @@
[Unit]
Description=Twice daily renewal of Let's Encrypt's certificates
[Timer]
OnCalendar=0/12:00:00
RandomizedDelaySec=1h
Persistent=true
[Install]
WantedBy=timers.target

View File

@@ -0,0 +1,10 @@
[Unit]
Description=Renewal of Let's Encrypt's certificates
[Timer]
OnCalendar=0/12:00:00
RandomizedDelaySec={{randomized_delay_sec}}
Persistent=true
[Install]
WantedBy=timers.target