From e2e9cfd16ab06d8ad30ebd5cc9f66ac46219b4b2 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Sun, 17 Jun 2018 13:11:47 +0200 Subject: o Adding mosquitto-server. --- .../renewal-hooks/deploy/mosquitto-server | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks/deploy/mosquitto-server (limited to 'ansible/roles/mosquitto-server/files/etc/letsencrypt/renewal-hooks') 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 -- cgit v1.2.3