Last active
August 29, 2015 14:06
-
-
Save ranjib/0690475ae7ba748e0b49 to your computer and use it in GitHub Desktop.
GoatOS
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
#!/bin/bash | |
clean () { | |
rm -f etc/* keys/*; | |
} | |
start_vm(){ | |
VM=$1 | |
SNAPSHOT=$2 | |
VBoxManage list runningvms | grep "$VM" | |
$? || VBoxManage controlvm "$VM" poweroff | |
VBoxManage snapshot "$VM" restore $SNAPSHOT | |
VBoxManage startvm "$VM" | |
sleep 60 | |
} | |
echo "------------ Running Standalone -----------------" | |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
clean | |
start_vm master sshkey | |
bundle exec goatos bootstrap -h 192.168.1.49 -N master -T standalone -i ranjib.rsa -u ranjib | |
echo "------------ Running Slave -----------------" | |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
start_vm slave sshkey | |
bundle exec goatos bootstrap -h 192.168.1.60 -N slave1 -T slave -i ranjib.rsa -u ranjib | |
echo "------------ Running GoatOS::LXC -----------------" | |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" | |
bundle exec goatos lxc ls | |
bundle exec goatos lxc create -N ct01 --expose 22:tcp:2201 | |
bundle exec goatos lxc start -N ct01 --expose 22:tcp:2201 | |
bundle exec goatos lxc ls | |
bundle exec goatos run-chef -i ranjib.rsa -u ranjib | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment