-
Notifications
You must be signed in to change notification settings - Fork 7
Chef Solo Guide
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)
- Vagrant Ubuntu Precise64 http://dl.dropbox.com/u/1537815/precise64.box
- Vagrant Ubuntu Lucid32 http://files.vagrantup.com/lucid32.box
- Vagrant 'CentOS 6.3' https://s3.amazonaws.com/itmat-public/centos-6.3-chef-10.14.2.box
- 'NeCTAR Ubuntu Lucid i386'
- 'NeCTAR Ubuntu 12.10 (Quantal) amd64 UEC'
- 'NeCTAR CentOS 6.4 x86_64'
- AMAZON CentOS 6.2 http://thecloudmarket.com/image/ami-8035b9b0--centos-6-2-x86-64-virtastic-120619
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 skip down to After Installing.
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 ($ echo "127.0.0.1 $(uname -n)" | sudo tee -a /etc/hosts
). This is a NeCTAR cloud issue.
You can copy and paste this:
sudo bash <<EOF
true && curl -L https://www.opscode.com/chef/install.sh | bash
apt-get update
apt-get install -y 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
EOF
sudo -E bash <<EOF
rpm --httpproxy $http_proxy -Uvh http://rbel.frameos.org/rbel6
yum -y install ruby ruby-devel 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
cd rubygems-1.8.10
ruby setup.rb --no-format-executable
# Bug in version 11.4.4 of gem.
gem install chef --no-ri --no-rdoc --version '11.4.2'
yum -y install git
mkdir -p /var/chef-solo
cd /var/chef-solo
mkdir mytardis-chef
git clone https://github.com/mytardis/mytardis-chef.git
cd mytardis-chef
if [ $http_proxy != "" ]; then echo http_proxy '"'$http_proxy'"' >> solo/solo.rb; fi
chef-solo -c solo/solo.rb -j solo/node.json -ldebug
EOF
MyTardis is now running! Just put http://[localhost or your server's IP address] in your browser.
Now create a MyTardis administrator :
- ssh into your server
sudo -su mytardis
cd /opt/mytardis/current
bin/django createsuperuser
Run unit tests:
sudo stop mytardis
cd /opt/mytardis/current
bin/django test --settings=tardis.test_settings
sudo start mytardis