infra/ansible/roles/lego/templates/lego_reload.sh.j2
2021-01-23 16:23:06 -05:00

15 lines
347 B
Django/Jinja

#!/bin/bash
export SOURCE_PEM=/etc/lego/certificates/{{ item.name }}.pem
export DEST_PEM=/etc/haproxy/certs/{{ item.name }}.pem
if [ -e ${DEST_PEM} ]; then
diff ${SOURCE_PEM} ${DEST_PEM}
diff_rc=$?
if [ ${diff_rc} == 0 ]; then
exit
fi
cp ${SOURCE_PEM} ${DEST_PEM}
chown haproxy:haproxy ${DEST_PEM}
systemctl reload haproxy
fi