aboutsummaryrefslogtreecommitdiffstats
path: root/roles/web/files
diff options
context:
space:
mode:
authorAaron LI <aly@aaronly.me>2019-10-03 18:04:34 +0800
committerAaron LI <aly@aaronly.me>2019-10-03 18:04:34 +0800
commit49069bb0f25594eec7a0d4c1c993afb73d8ce961 (patch)
treee10bd75e6343bf5029c036c6c8ea0cf3c93f773a /roles/web/files
parentbeae95aa22d5b81544678d8b3ab0182b0e971087 (diff)
downloadansible-dfly-vps-49069bb0f25594eec7a0d4c1c993afb73d8ce961.tar.bz2
web: Employ monthly periodic task to renew certificates
Diffstat (limited to 'roles/web/files')
-rw-r--r--roles/web/files/600.acme-sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/web/files/600.acme-sh b/roles/web/files/600.acme-sh
new file mode 100644
index 0000000..fdf4cc4
--- /dev/null
+++ b/roles/web/files/600.acme-sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# Monthly task to renew and deploy acme certificates.
+
+if [ -r /etc/defaults/periodic.conf ]; then
+ . /etc/defaults/periodic.conf
+ source_periodic_confs
+fi
+
+export PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+
+case "$monthly_acme_sh_enable" in
+ [Yy][Ee][Ss])
+ echo
+ echo "Checking Let's Encrypt certificates:"
+ if [ -x "$monthly_acme_sh_renewscript" ]; then
+ echo "Renewing certificates ..."
+ $monthly_acme_sh_renewscript
+ if [ -x "$monthly_acme_sh_deployscript" ]; then
+ echo "Deploying certificates ..."
+ $monthly_acme_sh_deployscript
+ fi
+ fi
+ ;;
+ *)
+ ;;
+esac