blob: 0e6c18b7dda6e90031e83f27412bc18a5be5b4a8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/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"
|