Created
January 12, 2018 11:18
-
-
Save andywirv/f499f96527627d4a728f91f8588d4694 to your computer and use it in GitHub Desktop.
Consul leaders
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fss_sandbox=consul.sandbox.fss | |
fss_production=consul.production.fss | |
apps=consul-apps.hashicorp | |
url=domain/v1/operator/raft/configuration?stale=true | |
declare -a consuls=($fss_sandbox $fss_production $apps) | |
for consul in "${consuls[@]}"; do | |
printf "%s Leader is: " "$consul"; | |
curl -s "http://$consul.$url\\n" |jq '.Servers[] | select(.Leader==true) | .Address' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment