2021-01-13 01:12:49 +00:00
|
|
|
#!/bin/bash
|
2021-01-23 21:23:06 +00:00
|
|
|
export SOURCE_PEM=/etc/lego/certificates/{{ item.name }}.pem
|
|
|
|
export DEST_PEM=/etc/haproxy/certs/{{ item.name }}.pem
|
2021-01-13 01:12:49 +00:00
|
|
|
|
|
|
|
if [ -e ${DEST_PEM} ]; then
|
2021-01-23 21:23:06 +00:00
|
|
|
diff ${SOURCE_PEM} ${DEST_PEM}
|
|
|
|
diff_rc=$?
|
|
|
|
if [ ${diff_rc} == 0 ]; then
|
2021-01-13 01:12:49 +00:00
|
|
|
exit
|
|
|
|
fi
|
|
|
|
cp ${SOURCE_PEM} ${DEST_PEM}
|
|
|
|
chown haproxy:haproxy ${DEST_PEM}
|
|
|
|
systemctl reload haproxy
|
|
|
|
fi
|