diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-03-21 15:55:10 +0100 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-03-21 15:55:10 +0100 |
commit | 891c7dc3cd11bd3e8a11ed19672bb057787d36c2 (patch) | |
tree | 9f7b43b1421c9f3e71aa718c036c309fcd3ff4c5 /roles/apps/mumble/templates/acmetool-reload.sh.j2 | |
parent | add some ssh keys for linuxtage (diff) |
add mumble to glt-coturn
Diffstat (limited to 'roles/apps/mumble/templates/acmetool-reload.sh.j2')
-rw-r--r-- | roles/apps/mumble/templates/acmetool-reload.sh.j2 | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/roles/apps/mumble/templates/acmetool-reload.sh.j2 b/roles/apps/mumble/templates/acmetool-reload.sh.j2 new file mode 100644 index 00000000..e3b8dbb7 --- /dev/null +++ b/roles/apps/mumble/templates/acmetool-reload.sh.j2 @@ -0,0 +1,31 @@ +#!/bin/sh +set -e +EVENT_NAME="$1" +[ "$EVENT_NAME" = "live-updated" ] || exit 42 + +MAIN_HOSTNAME="{{ mumble_hostnames[0] }}" +SSL_D="{{ mumble_base_path }}/{{ mumble_instance }}/config/ssl" + +while read name; do + certdir="$ACME_STATE_DIR/live/$name" + if [ -z "$name" -o ! -e "$certdir" ]; then + continue + fi + if [ "$name" != "$MAIN_HOSTNAME" ]; then + continue + fi + + install -m 0644 -o root -g mumble "$certdir/fullchain" "$SSL_D/cert.pem" + install -m 0640 -o root -g mumble "$certdir/privkey" "$SSL_D/privkey.pem" + +{% if kubernetes_cri_socket %} + export CONTAINER_RUNTIME_ENDPOINT="{{ kubernetes_cri_socket }}" +{% endif %} + pod_id=$(crictl pods -q --state ready --name "^mumble-{{ mumble_instance }}-{{ ansible_nodename }}$") + [ -n "$pod_id" ] || exit 42 + container_id=$(crictl ps -q --name '^mumble$' -p "$pod_id") + [ -n "$container_id" ] || exit 42 + crictl exec "$container_id" kill -USR1 1 + + break +done |