mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-22 20:51:07 +01:00
Optimized randomized_delay_sec, persistend & on_calendar for systemd-timer
This commit is contained in:
parent
01231cab6b
commit
0591f927ec
@ -1,14 +1,20 @@
|
|||||||
# Server Tact Variables
|
# Server Tact Variables
|
||||||
# @see https://man.archlinux.org/man/systemd.time.7
|
# validate timers via: systemctl list-timers
|
||||||
|
# more information: https://man.archlinux.org/man/systemd.time.7
|
||||||
|
|
||||||
|
randomized_delay_sec: "15min"
|
||||||
|
|
||||||
on_calendar_btrfs_health_check: "*-*-* 00:00:00"
|
on_calendar_btrfs_health_check: "*-*-* 00:00:00"
|
||||||
on_calendar_journalctl_health_check: "*-*-* 00:00:00"
|
on_calendar_journalctl_health_check: "*-*-* 00:00:00"
|
||||||
on_calendar_disc_space_check: "*-*-* 06,12,18,00:00:00"
|
on_calendar_disc_space_check: "*-*-* 06,12,18,00:00:00"
|
||||||
on_calendar_docker_health_check: "*-*-* 09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,00,01,02:00:00"
|
on_calendar_docker_health_check: "*-*-* 09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,00,01,02:00:00"
|
||||||
|
|
||||||
on_calendar_backups_cleanup: "*-*-* 06,12,18,00:30:00"
|
on_calendar_backups_cleanup: "*-*-* 06,12,18,00:30:00"
|
||||||
on_calendar_docker_volume_backup: "*-*-* 03:30:00"
|
on_calendar_docker_volume_backup: "*-*-* 03:30:00"
|
||||||
on_calendar_docker_compose_restart_unhealthy: "*-*-* 09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,00,01:30:00"
|
on_calendar_docker_compose_restart_unhealthy: "*-*-* 09,10,11,12,13,14,15,16,17,18,19,20,21,22,23,00,01:30:00"
|
||||||
on_calendar_pull_primary_backups: "*-*-* 21:30:00"
|
on_calendar_pull_primary_backups: "*-*-* 21:30:00"
|
||||||
|
on_calendar_renew_lets_encrypt_certificates: "*-*-* 12,00:30:00"
|
||||||
|
on_calendar_deploy_mailu_certificates: "*-*-* 12,00:50:00"
|
||||||
|
|
||||||
# Space Variables
|
# Space Variables
|
||||||
size_percent_maximum_backup: 75
|
size_percent_maximum_backup: 75
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=Twice daily deployment of Let's Encrypt's certificates
|
Description=Deployment of Let's Encrypt's certificates
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar=0/12:00:00
|
OnCalendar={{on_calendar_deploy_mailu_certificates}}
|
||||||
RandomizedDelaySec=1h
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
Persistent=true
|
Persistent=true
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
Description=starts backups-cleanup.service
|
Description=starts backups-cleanup.service
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnBootSec=1min
|
|
||||||
OnCalendar={{on_calendar_backups_cleanup}}
|
OnCalendar={{on_calendar_backups_cleanup}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
@ -3,6 +3,8 @@ Description=starts btrfs-health-check.service
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar_btrfs_health_check}}
|
OnCalendar={{on_calendar_btrfs_health_check}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
- name: "restart certbot service"
|
- name: "reload certbot service"
|
||||||
systemd:
|
systemd:
|
||||||
name: certbot.service
|
name: certbot.service
|
||||||
state: restarted
|
state: reloaded
|
||||||
enabled: yes
|
enabled: yes
|
||||||
daemon_reload: yes
|
daemon_reload: yes
|
||||||
- name: "restart certbot timer"
|
- name: "restart certbot timer"
|
||||||
|
@ -2,12 +2,15 @@
|
|||||||
pacman:
|
pacman:
|
||||||
name: [certbot,certbot-nginx]
|
name: [certbot,certbot-nginx]
|
||||||
state: present
|
state: present
|
||||||
notify: restart certbot service
|
|
||||||
|
|
||||||
- name: configure certbot.service.tpl
|
- name: configure certbot.service.tpl
|
||||||
template: src=certbot.service dest=/etc/systemd/system/certbot.service
|
template:
|
||||||
notify: restart certbot service
|
src: certbot.service.j2
|
||||||
|
dest: /etc/systemd/system/certbot.service
|
||||||
|
notify: reload certbot service
|
||||||
|
|
||||||
- name: configure certbot.timer.tpl
|
- 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
|
notify: restart certbot timer
|
||||||
|
@ -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
|
|
10
roles/native-certbot-nginx/templates/certbot.timer.j2
Normal file
10
roles/native-certbot-nginx/templates/certbot.timer.j2
Normal 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
|
@ -3,6 +3,8 @@ Description=starts disc-space-check.service
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar_disc_space_check}}
|
OnCalendar={{on_calendar_disc_space_check}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=true
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
@ -3,6 +3,8 @@ Description=starts docker-compose-restart-unhealthy.service
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar_docker_compose_restart_unhealthy}}
|
OnCalendar={{on_calendar_docker_compose_restart_unhealthy}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
@ -3,6 +3,8 @@ Description=starts docker-health-check.service
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar_docker_health_check}}
|
OnCalendar={{on_calendar_docker_health_check}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
@ -3,6 +3,8 @@ Description=backups the docker volumes
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar_docker_volume_backup}}
|
OnCalendar={{on_calendar_docker_volume_backup}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
@ -3,6 +3,8 @@ Description=starts journalctl-health-check.service
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar_journalctl_health_check}}
|
OnCalendar={{on_calendar_journalctl_health_check}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
@ -3,6 +3,8 @@ Description=starts pull remote backup timer
|
|||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
OnCalendar={{on_calendar_pull_primary_backups}}
|
OnCalendar={{on_calendar_pull_primary_backups}}
|
||||||
|
RandomizedDelaySec={{randomized_delay_sec}}
|
||||||
|
Persistent=false
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
|
Loading…
Reference in New Issue
Block a user