#!/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