Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update health check to better find certs for curl #131

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading