Skip to content

Instantly share code, notes, and snippets.

@ranjib
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ranjib/0690475ae7ba748e0b49 to your computer and use it in GitHub Desktop.
Save ranjib/0690475ae7ba748e0b49 to your computer and use it in GitHub Desktop.
GoatOS
#!/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