Skip to content

Instantly share code, notes, and snippets.

@christianromney
Forked from retr0h/gist:132506
Created August 20, 2009 03:43
Show Gist options
  • Save christianromney/170804 to your computer and use it in GitHub Desktop.
Save christianromney/170804 to your computer and use it in GitHub Desktop.
Ubuntu Chef Bootstrapper
#!/bin/sh
trap "exit 2" 1 2 3 13 15
OPTS="--no-rdoc --no-ri"
if [ -f "/etc/lsb-release" ]; then
### bootstrap with git.
apt-get update -y && apt-get upgrade -y --force-yes && apt-get install -y git-core vim
### bootstrap with ruby+deps.
apt-get install -y ruby ruby1.8-dev rubygems libopenssl-ruby1.8 libsqlite3-ruby irb build-essential syslog-ng
### upgrade rubygems, debian's version is old.
gem source -a http://gems.rubyforge.org && gem source -a http://gems.github.com && gem source -a http://gems.opscode.com && \
gem install rubygems-update --version=1.3.4 ${OPTS} && /var/lib/gems/1.8/bin/update_rubygems
### download the chef-solo repo.
cd /tmp && git clone git://github.com/xmlblog/chef_solo_os.git && cd /tmp/chef_solo_os
### Run chef solo.
gem install chef ohai ${OPTS} && \
chef-solo -l debug -c config/solo.rb -j config/dna.json
else
echo "[ERROR] OS unsupported."
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment