Skip to content

Instantly share code, notes, and snippets.

@jeremypruitt
Created September 9, 2009 05:24
Show Gist options
  • Save jeremypruitt/183493 to your computer and use it in GitHub Desktop.
Save jeremypruitt/183493 to your computer and use it in GitHub Desktop.
#!/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
### bootstrap with ruby+deps.
apt-get install -y ruby ruby1.8-dev rubygems libopenssl-ruby1.8 libsqlite3-ruby irb build-essential
### 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.
mkdir -p /tmp/chef-solo
cd /tmp/chef-colo && git clone git://github.com/retr0h/chef_solo_os.git
cat > /tmp/chef-solo/solo.rb <<-End-of-message
file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
End-of-message
cat > /tmp/chef-solo/rocksocial.json <<End-of-message
{
"recipes": [ "nginx", "mysql", "solr", "rails", "screen", "capistrano", "users" ]
}
End-of-message
### Run chef solo.
gem install chef ohai ${OPTS} && \
chef-solo -l debug -c /tmp/chef-solo/solo.rb -j /tmp/chef-solo/rocksocial.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