diff --git a/templates/pgpool-letsencrypt-acme.sh.j2 b/templates/pgpool-letsencrypt-acme.sh.j2 index bd0f0b5..14085ab 100644 --- a/templates/pgpool-letsencrypt-acme.sh.j2 +++ b/templates/pgpool-letsencrypt-acme.sh.j2 @@ -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" %}