From aa13fbd9278c1d9810acf7e88fdaeb9443ff1eb8 Mon Sep 17 00:00:00 2001 From: Robert Waffen Date: Wed, 9 Oct 2024 10:06:22 +0200 Subject: [PATCH] fix: update health check to better find certs fur curl Signed-off-by: Robert Waffen --- puppetserver/healthcheck.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/puppetserver/healthcheck.sh b/puppetserver/healthcheck.sh index 07b54e91..462088d0 100755 --- a/puppetserver/healthcheck.sh +++ b/puppetserver/healthcheck.sh @@ -4,19 +4,18 @@ set -x set -e timeout=10 + if [ "$#" -gt 0 ]; then timeout=$1 fi -certname=$(cd "${SSLDIR}/certs" && ls *.pem | grep --invert-match ca.pem) - curl --fail \ --no-progress-meter \ --max-time ${timeout} \ --resolve "${HOSTNAME}:${PUPPETSERVER_PORT:-8140}:127.0.0.1" \ - --cert "${SSLDIR}/certs/$certname" \ - --key "${SSLDIR}/private_keys/$certname" \ - --cacert "${SSLDIR}/certs/ca.pem" \ + --cert $(puppet config print hostcert) \ + --key $(puppet config print hostprivkey) \ + --cacert $(puppet config print localcacert) \ "https://${HOSTNAME}:${PUPPETSERVER_PORT:-8140}/status/v1/simple" \ | grep -q '^running$' \ || exit 1