~damien/infrastructure

ref: ae6cae9679736af034c2b21fe2f5e3dd290739db infrastructure/scripts/healthcheck-nomad.sh -rwxr-xr-x 392 bytes
ae6cae96 — Damien Radtke Add healthcheck provisioner to Nomad clients 8 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash

while true; do
	leader="$(curl \
		--silent \
		--show-error \
		--fail \
		--cacert /etc/ssl/nomad/ca.pem \
		--cert /etc/ssl/nomad/cli.pem \
		--key /etc/ssl/nomad/cli-key.pem \
		https://localhost:4646/v1/status/leader)"
	if [[ $? -eq 0 ]]; then
		echo "Found leader: ${leader}"
		exit 0
	fi
	echo "No leader found, sleeping and trying again: ${leader}"
	sleep 2
done