Skip to content

Commit

Permalink
fix: update health check to better find certs fur curl
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Waffen <[email protected]>
  • Loading branch information
rwaffen committed Oct 9, 2024
1 parent f9c564f commit aa13fbd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions puppetserver/healthcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aa13fbd

Please sign in to comment.