Skip to content
This repository was archived by the owner on Feb 14, 2025. It is now read-only.

Commit ddf7a2b

Browse files
authored
Merge pull request #131 from voxpupuli/130-container-health-check-fails-after-creating-a-certificate
feat: update health check to better find certs for curl
2 parents f9c564f + 0594e39 commit ddf7a2b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

puppetserver/healthcheck.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,18 @@ set -x
44
set -e
55

66
timeout=10
7+
78
if [ "$#" -gt 0 ]; then
89
timeout=$1
910
fi
1011

11-
certname=$(cd "${SSLDIR}/certs" && ls *.pem | grep --invert-match ca.pem)
12-
1312
curl --fail \
1413
--no-progress-meter \
1514
--max-time ${timeout} \
1615
--resolve "${HOSTNAME}:${PUPPETSERVER_PORT:-8140}:127.0.0.1" \
17-
--cert "${SSLDIR}/certs/$certname" \
18-
--key "${SSLDIR}/private_keys/$certname" \
19-
--cacert "${SSLDIR}/certs/ca.pem" \
16+
--cert $(puppet config print hostcert) \
17+
--key $(puppet config print hostprivkey) \
18+
--cacert $(puppet config print localcacert) \
2019
"https://${HOSTNAME}:${PUPPETSERVER_PORT:-8140}/status/v1/simple" \
2120
| grep -q '^running$' \
2221
|| exit 1

0 commit comments

Comments
 (0)