Skip to content

Instantly share code, notes, and snippets.

@ryantownsend
Forked from ryanb/chef_solo_bootstrap.sh
Created July 1, 2012 13:11
Show Gist options
  • Select an option

  • Save ryantownsend/3028390 to your computer and use it in GitHub Desktop.

Select an option

Save ryantownsend/3028390 to your computer and use it in GitHub Desktop.
Bootstrap Chef Solo
#!/bin/bash
# This runs as root on the server
chef_binary=/var/lib/gems/1.9.1/bin/chef-solo
# Are we on a vanilla system?
if ! test -f "$chef_binary"; then
export DEBIAN_FRONTEND=noninteractive
# Upgrade headlessly (this is only safe-ish on vanilla systems)
aptitude update &&
apt-get -o Dpkg::Options::="--force-confnew" \
--force-yes -fuy dist-upgrade &&
# Install Ruby and Chef
aptitude install -y ruby1.9.1 ruby1.9.1-dev make &&
sudo gem1.9.1 install --no-rdoc --no-ri chef --version 0.10.0
fi &&
"$chef_binary" -c solo.rb -j solo.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment