Skip to content

Chef Solo Guide

steveandroulakis edited this page Apr 30, 2013 · 52 revisions

This is a brief, informal guide on running chef-solo on a server with the MyTardis recipe. This deploys a recipe on the machine that's executing this and doesn't require a chef server (Hosted Chef or other).

Confirmed working on these images (built from NeCTAR, tested on 17 Jan 2013)

Option 1: Deploy on your local machine with Vagrant

Follow the Vagrant getting started guide up to the point of adding the lucid32 box, then follow the commands below.

git clone https://github.com/mytardis/mytardis-chef.git
cd mytardis-chef/
cd vagrant/lucid32/
vagrant up

The server will be available on localhost:8000.

Note: This also works on CentOS 6 / Ubuntu Precise 64. vagrant box add centos6 https://s3.amazonaws.com/itmat-public/centos-6.3-chef-10.14.2.box then follow the instructions above (except cd vagrant/centos6/ or vagrant/precise64 instead of lucid32).

Use vagrant ssh then cd /opt/mytardis/current and bin/django createsuperuser to create a MyTardis administrator.

Run unit tests with cd /opt/mytardis/current then bin/django test --settings=tardis.test_settings (make sure MyTardis is not running with stop mytardis first)

Option 2: Install on a server (non-vagrant chef build)

Non-vagrant setup appropriate for installation on Amazon EC2, NeCTAR, or anything else you have root to.

Note: If your NeCTAR cloud node is complaining about not being able to resolve its hostname then fix it first before running this guide (add hostname 127.0.0.1 to /etc/hosts). This is a NeCTAR cloud issue.

Ubuntu Lucid:

sudo true && curl -L https://www.opscode.com/chef/install.sh | sudo bash
sudo apt-get update
sudo apt-get install git-core
mkdir -p /var/chef-solo
cd /var/chef-solo
git clone https://github.com/mytardis/mytardis-chef.git
cd mytardis-chef/
chef-solo -c solo/solo.rb -j solo/node.json -ldebug

CentOS 6:

Currently broken in recent builds due to bug http://tickets.opscode.com/browse/CHEF-4123

sudo rpm -Uvh http://rbel.frameos.org/rbel6
sudo yum install ruby ruby-devel ruby-ri ruby-rdoc ruby-shadow gcc gcc-c++ automake autoconf make curl dmidecode
cd /tmp
curl -O http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz
tar zxf rubygems-1.8.10.tgz
sudo ruby setup.rb --no-format-executable
sudo gem install chef --no-ri --no-rdoc
sudo yum install git
mkdir -p /var/chef-solo
cd /var/chef-solo
git clone https://github.com/mytardis/mytardis-chef.git
cd mytardis-chef/
chef-solo -c solo/solo.rb -j solo/node.json -ldebug

Server runs on http://SERVER_IP_ADDRESS

ssh into your server, then cd /opt/mytardis/current and bin/django createsuperuser to create a MyTardis administrator.

Run unit tests with cd /opt/mytardis/current then bin/django test --settings=tardis.test_settings (make sure MyTardis is not running with stop mytardis first)

Clone this wiki locally