Install VirtualBox and then Vagrant.
For now it only supports Vagrant up to 1.4.3 (`vagrant-berkshelf plugin doesn't work yet with Vagrant 1.5.0).
gem install berkshelf
vagrant plugin install vagrant-berkshelf
vagrant plugin install vagrant-omnibus
vagrant plugin install vagrant-digitalocean
Get config files
cd ~/your/project/root
curl https://raw.github.com/zigomir/do_ruby/master/Berksfile.SAMPLE -o Berksfile
curl https://raw.github.com/zigomir/do_ruby/master/Vagrantfile -o Vagrantfile
curl https://raw.github.com/zigomir/do_ruby/master/server_config.SAMPLE.yml -o server_config.yml
Edit server_config.yml
and check out Vagrantfile
and Berksfile
.
berks install
vagrant up
We're using Vagrant-DigitalOcean plugin to set up a droplet on DigitalOcean.
If you've build your machine with VirtualBox provider before you'll probably need
to destroy it first, since Vagrant doesn't support multiple providers on same box
just yet. But they plan to. Command for destroying is vagrant destroy
.
vagrant up --provider=digital_ocean
This might take a while. Especially if you're creating droplet with 512 MB of ram. Because user will be created pretty soon in the process you can see what is going on on the server.
ssh deployer@ip
top
ssh deployer@ip
cat .ssh/id_dsa.pub # add to https://github.com/settings/ssh
ssh -T [email protected]
exit
You can get into trouble if you're gonna use this cookbook from different machines. This is because when you will create new droplet for the first time it will generate a new Vagrant ssh key and send it to server. On another machine you won't have same key.
Shared folders that Chef requires are missing on the virtual machine.
This is usually due to configuration changing after already booting the
machine. The fix is to run a `vagrant reload` so that the proper shared
folders will be prepared and mounted on the VM.
This is unfortunately a problem on Windows currently. I don't know yet how to work around, but this doesn't happen on OS X and probably Linux too.