tripleo-common/healthcheck/swift-proxy
Martin André 0389eece17 Make curl healthchecks work with internal TLS
Implement a new get_url_from_vhost bash function that parses the given
vhost configuration file and returns the URL on which the service can
be checked.

Change-Id: I071ed26328703df9f272b689af854e3a6a1c9e97
Closes-Bug: #1713689
2017-08-30 13:19:25 +02:00

16 lines
471 B
Bash
Executable File

#!/bin/sh
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
conf=/etc/swift/proxy-server.conf
if ! crudini --get $conf pipeline:main pipeline | grep -q healthcheck; then
echo "healthcheck is not available" >&2
exit 0
fi
# swift-proxy is still eventlet
bind_host=$(get_config_val $conf DEFAULT bind_ip 127.0.0.1)
bind_port=$(get_config_val $conf DEFAULT bind_port 8080)
healthcheck_curl http://${bind_host}:${bind_port}/healthcheck