tripleo-common/healthcheck/ironic-inspector
Bob Fournier 6b3b39f695 Use port 547 for dhcpv6 healthchecks when using IPv6
Check the listen-address to determine if using IPv6 on
the ctlplane and set the DHCP port accordingly.

Change-Id: I5602aa1298dda998b9a58f7234593683281414c3
Closes-Bug: 1847380
2019-10-21 07:14:38 +00:00

24 lines
840 B
Bash
Executable File

#!/bin/sh
. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh
process='dnsmasq'
if pgrep $process; then
listen_address=$(get_config_val /etc/ironic-inspector/inspector.conf DEFAULT listen_address 127.0.0.1)
# Check DHCPv6 port if using IPv6
if [[ $listen_address =~ ":" ]]; then
port="547"
else
port="67"
fi
echo "Checking $process port(s) $port."
if ! healthcheck_listen $process $port; then
echo "There is no $process process listening on port(s) $port in the container."
exit 1
fi
else
bind_host=$(get_config_val /etc/ironic-inspector/inspector.conf DEFAULT listen_address 127.0.0.1)
bind_port=$(get_config_val /etc/ironic-inspector/inspector.conf DEFAULT listen_port 5050)
healthcheck_curl http://${bind_host}:${bind_port}
fi