Skip to content

Commit

Permalink
Merge pull request #131 from voxpupuli/130-container-health-check-fai…
Browse files Browse the repository at this point in the history
…ls-after-creating-a-certificate

feat: update health check to better find certs for curl
  • Loading branch information
rwaffen authored Oct 9, 2024
2 parents f9c564f + 0594e39 commit ddf7a2b
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 ddf7a2b

Please sign in to comment.