aboutsummaryrefslogtreecommitdiffstats
path: root/roles/web/templates
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/templates
parentbeae95aa22d5b81544678d8b3ab0182b0e971087 (diff)
downloadansible-dfly-vps-49069bb0f25594eec7a0d4c1c993afb73d8ce961.tar.bz2
web: Employ monthly periodic task to renew certificates
Diffstat (limited to 'roles/web/templates')
-rw-r--r--roles/web/templates/acme/renew.sh.j217
1 files changed, 17 insertions, 0 deletions
diff --git a/roles/web/templates/acme/renew.sh.j2 b/roles/web/templates/acme/renew.sh.j2
new file mode 100644
index 0000000..33d5879
--- /dev/null
+++ b/roles/web/templates/acme/renew.sh.j2
@@ -0,0 +1,17 @@
+#!/bin/sh
+#
+# Renew 'acme.sh' issued certificates.
+#
+# Aaron LI
+# 2019-10-03
+#
+
+[ $(id -u) -eq 0 ] || {
+ echo "ERROR: must be run by root!"
+ exit 1
+}
+
+su - acme \
+ -c "acme.sh --cron --log /var/log/acme.sh.log \
+ --config-home {{ web.acme_home }}/.acme.sh \
+ --cert-home {{ web.acme_home }}/certs"