1
1
mirror of https://gitlab.archlinux.org/archlinux/infrastructure.git synced 2025-01-18 08:06:16 +01:00
infrastructure/roles/postgres/templates/letsencrypt.hook.d.j2
Evangelos Foutras f0a0060c62
postgres: fix letsencrypt renewal hook
It was using a nonexistent target path when copying the renewed cert and
was not reloading postgresql.service in order for it to reload the certs.
2022-04-20 19:32:14 +03:00

20 lines
499 B
Django/Jinja

#!/bin/sh
test "$1" = renew || exit 0
postgres_domain="{{ inventory_hostname }}"
for domain in $RENEWED_DOMAINS; do
case "$domain" in
$postgres_domain)
for pem in {privkey,fullchain,chain}.pem; do
install -o postgres -g postgres -m 400 \
/etc/letsencrypt/live/$postgres_domain/$pem \
/var/lib/postgres/data/$pem
done
systemctl reload postgresql
break
;;
esac
done