You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
458 B
30 lines
458 B
#!/bin/sh
|
|
|
|
set -Eeuo pipefail
|
|
trap "exit" INT
|
|
|
|
function start () {
|
|
for i; do
|
|
sudo virsh start "$i" || true
|
|
done
|
|
}
|
|
|
|
function wait_for_ip () {
|
|
echo "Waiting for $1 to come online..."
|
|
while ! ping -n -c4 -i.2 $2 -q &>/dev/null; do
|
|
sleep 1
|
|
done
|
|
}
|
|
|
|
%{for host, ip in others~}
|
|
start "${host}"
|
|
wait_for_ip "${host}" "${ip}"
|
|
%{endfor~}
|
|
|
|
%{for host, ip in masters~}
|
|
start "${host}"
|
|
%{endfor~}
|
|
|
|
%{for host, ip in workers~}
|
|
start "${host}"
|
|
%{endfor~}
|
|
|