Always reload the service.

This commit is contained in:
Andrea Dell'Amico 2021-07-05 11:43:18 +02:00
parent d2c923939e
commit d7a98e5ba2
Signed by: adellam
GPG Key ID: 147ABE6CEB9E20FF
1 changed files with 7 additions and 8 deletions

View File

@ -16,19 +16,18 @@ logger "acme-pgpool-hook: Check if the certificate has been renewed"
cmp ${LE_CERTS_DIR}/privkey ${PGPOOL2_KEYFILE}
RETVAL=$?
if [ $RETVAL -eq 0 ] ; then
logger "acme-pgpool-hook: No new cerficate. Doing nothing"
echo "acme-pgpool-hook: No new cerficate. Doing nothing" >> $LE_LOG_DIR/pgpool2.log
exit 0
logger "acme-pgpool-hook: No new cerficate"
echo "acme-pgpool-hook: No new cerficate" >> $LE_LOG_DIR/pgpool2.log
else
logger "acme-pgpool-hook: Copying the key file"
echo "Copy the key file" >> $LE_LOG_DIR/pgpool2.log
/bin/cp -f ${LE_CERTS_DIR}/privkey ${PGPOOL2_KEYFILE}
fi
logger "acme-pgpool-hook: Copying the key file"
echo "Copy the key file" >> $LE_LOG_DIR/pgpool2.log
cp ${LE_CERTS_DIR}/privkey ${PGPOOL2_KEYFILE}
chmod 440 ${PGPOOL2_KEYFILE}
chown root ${PGPOOL2_KEYFILE}
chgrp postgres ${PGPOOL2_KEYFILE}
logger "acme-pgpool-hook: Reload the postgresql service after a certificate renewal"
logger "acme-pgpool-hook: Reload the PgPoolII service after a letsencrypt execution"
echo "Reload the pgpool2 service" >> $LE_LOG_DIR/pgpool2.log
if [ -x /bin/systemctl ] ; then
{% if ansible_distribution_file_variety == "Debian" %}