#!/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)