summaryrefslogtreecommitdiff
path: root/roles/apache_server/templates/deploy_static_site_certs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2018-05-12 20:28:44 +0300
committerLars Wirzenius <liw@liw.fi>2018-05-12 20:28:44 +0300
commita0b4020cbca74ab6c833b542840a9e2cdfda8abc (patch)
treeef00583c29f780d85aab3bdef1a09a6215b5a68a /roles/apache_server/templates/deploy_static_site_certs
parent9443898ed15a4fa7b8d2712a073b1bd2b011fa0a (diff)
downloaddebian-ansible-a0b4020cbca74ab6c833b542840a9e2cdfda8abc.tar.gz
Add: support optional Let's Encrypt TLS certs for static web sites
Diffstat (limited to 'roles/apache_server/templates/deploy_static_site_certs')
-rw-r--r--roles/apache_server/templates/deploy_static_site_certs27
1 files changed, 27 insertions, 0 deletions
diff --git a/roles/apache_server/templates/deploy_static_site_certs b/roles/apache_server/templates/deploy_static_site_certs
new file mode 100644
index 0000000..32ace4e
--- /dev/null
+++ b/roles/apache_server/templates/deploy_static_site_certs
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -eu
+
+
+domains()
+{
+ cd /etc/letsencrypt/static_sites
+ ls
+}
+
+
+opts()
+{
+ for domain in $(domains)
+ do
+ echo -w "/srv/http/$domain" -d "$domain"
+ done
+}
+
+
+certbot certonly \
+ --noninteractive \
+ --email "{{ letsencrypt_email }}" \
+ --agree-tos \
+ --expand \
+ --webroot $(opts)