Skip to content

Instantly share code, notes, and snippets.

@jeremypruitt
Created September 9, 2009 05:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremypruitt/183494 to your computer and use it in GitHub Desktop.
Save jeremypruitt/183494 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
# Name this host satsang.martinisatnoon.com
hostname satsang
cat > /etc/hosts <<-End-of-message
127.0.0.1 satsang.martinisatnoon.com satsang localhost localhost.localdomain
End-of-message
### 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 libshadow-ruby1.8
### 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-solo && git clone git://github.com/opscode/cookbooks.git
git clone git@github.com:redpillsystems/satsang-infrastructure.git
cp -r satsang-infrastructure/chef/cookbooks/* cookbooks/
cat > /tmp/chef-solo/solo.rb <<-End-of-message
file_cache_path "/tmp/chef-solo"
cookbook_path "/tmp/chef-solo/cookbooks"
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/satsang-infrastructure/chef/nodes/satsang.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