infra/ansible/roles/lego/templates/lego_reload.sh.j2

13 lines
310 B
Text
Raw Normal View History

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