Files
packstack-vagrant/scripts/bootstrap.sh
Christian Berendt d068a5f61c Use a proxy instead of vagrant-cachier
Change-Id: I867ffd2896d9f398bb4686622073044b666031b4
2014-12-12 21:01:51 +00:00

34 lines
846 B
Bash
Executable File

#!/bin/bash
run() {
number=$1
shift
python scripts/get_hosts.py | grep -v controller | xargs -n 1 -P $number \
-I BOX sh -c "echo - BOX && (vagrant $* BOX 2>&1 >> log/BOX.log)"
}
if [[ ! -e config.yaml ]]; then
echo "error: configuration file 'config.yaml' does not exist"
exit 1
fi
echo "$(date) cleaning up"
rm -f log/*
vagrant destroy
echo "$(date) bringign up, provisioning and reloading the controller VM"
vagrant up controller >> log/controller.log
vagrant reload controller >> log/controller.log
echo "$(date) brining up all VMs"
run 2 up --no-provision
echo "$(date) provisioning all other VMs"
run 4 provision
echo "$(date) reloading all other VMs"
run 4 reload
echo "$(date) initializing the controller node"
vagrant ssh controller -c '/home/vagrant/scripts/initialize.sh' 2>&1 >> log/controller.log