diff options
Diffstat (limited to 'roles/apache_server/templates/deploy_static_site_certs')
-rw-r--r-- | roles/apache_server/templates/deploy_static_site_certs | 29 |
1 files changed, 29 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..3521651 --- /dev/null +++ b/roles/apache_server/templates/deploy_static_site_certs @@ -0,0 +1,29 @@ +#!/bin/sh + +set -eu + + +domains() +{ + cd /etc/letsencrypt/static_sites + ls +} + + +opts() +{ + for domain in $(domains) + do + echo -w "/srv/http/$domain" -d "$domain" \ + --webroot-path "/srv/letsencrypt/$domain" + done +} + + +certbot certonly \ + --noninteractive \ + --email "{{ letsencrypt_email }}" \ + --agree-tos \ + --expand \ + --cert-name static_sites \ + --webroot $(opts) |