diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2018-06-17 13:11:47 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2018-06-17 13:11:47 +0200 |
commit | e2e9cfd16ab06d8ad30ebd5cc9f66ac46219b4b2 (patch) | |
tree | 09f527771ffb9af015d05f494ec7ccbccbe62793 /ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks | |
parent | 0f9a79c433f26ef12c8e22a97c41d755ce3b8590 (diff) | |
download | infra-e2e9cfd16ab06d8ad30ebd5cc9f66ac46219b4b2.tar.gz infra-e2e9cfd16ab06d8ad30ebd5cc9f66ac46219b4b2.tar.bz2 infra-e2e9cfd16ab06d8ad30ebd5cc9f66ac46219b4b2.tar.xz infra-e2e9cfd16ab06d8ad30ebd5cc9f66ac46219b4b2.zip |
o Adding mosquitto-server.
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 |