#!/bin/bash set -e PING_HOSTNAME="{{ traefik_host }}" VIRTUAL_IP="{{ keepalived_virtual_ip }}" function do_ping() { local endpoint_hostname="$1" local vip="$2" curl -s -o /dev/null -w "%{http_code}" --resolve "$endpoint_hostname:443:$vip" "https://$endpoint_hostname/ping" } test "$(do_ping "$PING_HOSTNAME" "$VIRTUAL_IP")" = "200"