Holder de Ord VM setup repository
Full tutorial about Vagrant can be found at http://devops.me/2011/10/05/vagrant/
$ sudo apt-get install vagrant
$ [sudo] gem install vagrant
Note that the
hdo-devel VM image requires at least Virtualbox 4.1.16.
For installation instructions, see this link.
Bring up the VM instance
After the inital checkout of the repo, you need check out the required submodules:
$ git submodule init $ git submodule update
After this, bringing up the VM is pretty simple (but can take some time depending on your hardware):
$ vagrant up
The first time you run this, Vagrant will download a pre-packaged VM image (
On subsequent runs, this brings up the VM, sets up port forwarding/shared folders (as configured in the
and provisions the VM with Puppet.
If you just want to provision an already running VM:
$ vagrant provision
Puppet code style
The tool requires a Ruby install + the puppet-lint gem:
$ [sudo] gem install puppet-lint $ bin/lint.sh
Test the configuration
test.sh script can do this for you. By default, it will destroy and
recreate the VM, provision it, set up password-less login, and do a cold deploy of the app (assumed to be in
If you want to skip the re-creation of the VM (i.e you've already done a cold deploy):
$ DEPLOY_ONLY=1 bin/test.sh
Check out the main website code repository:
$ git checkout https://github.com/holderdeord/hdo-site.git ../hdo-site
Bring up the VM instance:
$ vagrant up
Set up password-less logins as
hdo user, which is needed for Capistrano deployment.
The password for these commands is 'vagrant':
$ cat ~/.ssh/id_dsa.pub | ssh -p 2222 vagrant@localhost "cat > ./key; sudo mkdir -p /home/hdo/.ssh; sudo mv ./key /home/hdo/.ssh/authorized_keys; sudo chown -R hdo:hdo /home/hdo/.ssh"
Launch the installation of the actual
$ cd ../hdo-site $ bundle install $ VAGRANT=1 cap deploy:setup deploy:cold # only needed first time $ VAGRANT=1 cap deploy
Installation on production servers
$ apt-get update $ apt-get install puppet git-core $ git clone git://github.com/holderdeord/hdo-puppet.git $ cd hdo-puppet $ git submodule update --init $ export FACTER_postgresql_hdo_password=t0ps3cret $ puppet apply --modulepath=puppet/modules puppet/site.pp
Then, locally from hdo-site:
$ cap deploy:setup deploy:cold
Creating the Vagrant .box image
If you can find a vagrant base box on www.vagrantbox.es, then it's quite easy. Unfortunately, there is none available (at least as of July 2012), so I had to build a custom image based on Ubuntu 12.04 server LTS i386.
That's the image I was referring to earlier in this document
when I talked about