Replace certsync cron job with systemd timer
This commit is contained in:
parent
9497d2ca35
commit
250a0cdaac
5 changed files with 34 additions and 13 deletions
|
@ -19,5 +19,5 @@ chmod 440 $CERT_DIR/*
|
|||
|
||||
COUNT=$(find $CERT_DIR -mtime -7 | wc -l)
|
||||
if [ $COUNT -gt 0 ]; then
|
||||
service nginx reload > /dev/null
|
||||
systemctl reload nginx > /dev/null
|
||||
fi
|
6
roles/certsync/templates/certsync.service
Normal file
6
roles/certsync/templates/certsync.service
Normal file
|
@ -0,0 +1,6 @@
|
|||
[Unit]
|
||||
Description=Synchronize TLS certificates from {{ certsync_host }}
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
ExecStart=/usr/local/sbin/certsync
|
10
roles/certsync/templates/certsync.timer
Normal file
10
roles/certsync/templates/certsync.timer
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Weekly certsync run
|
||||
|
||||
[Timer]
|
||||
OnCalendar=Mon *-*-* 05:00
|
||||
RandomizedDelaySec=60m
|
||||
Persistent=true
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
Loading…
Add table
Add a link
Reference in a new issue