diff options
Diffstat (limited to 'ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks')
-rw-r--r-- | ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks/deploy/mosquitto-server | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks/deploy/mosquitto-server b/ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks/deploy/mosquitto-server new file mode 100644 index 0000000..cf9fc45 --- /dev/null +++ b/ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks/deploy/mosquitto-server @@ -0,0 +1,20 @@ +#!/bin/bash + +set -e +set -x + +for domain in $RENEWED_DOMAINS; do + case $domain in + trygvis.io) + umask 077 + + cp "$RENEWED_LINEAGE/fullchain.pem" "/etc/mosquitto/certs/$domain-fullchain.pem" + cp "$RENEWED_LINEAGE/privkey.pem" "/etc/mosquitto/certs/$domain-privkey.pem" + + chown mosquitto "/etc/mosquitto/certs/$domain-fullchain.pem" "/etc/mosquitto/certs/$domain-privkey.pem" + chmod 400 "/etc/mosquitto/certs/$domain-fullchain.pem" "/etc/mosquitto/certs/$domain-privkey.pem" + + systemctl restart mosquitto >/dev/null + ;; + esac +done |