Skip to content

Instantly share code, notes, and snippets.

@croaker
Forked from ryanb/chef_solo_bootstrap.sh
Created April 20, 2012 10:43
Show Gist options
  • Save croaker/2427731 to your computer and use it in GitHub Desktop.
Save croaker/2427731 to your computer and use it in GitHub Desktop.
Bootstrap Chef Solo on Ubuntu or Amazon AMIs
#!/usr/bin/env bash
RUBY_VERSION=1.9.3-p194
if [ -n `which yum` ]
then
# This is necessary for the Amazon Linux AMI
perl -pi -e 's/^(Defaults\s+secure_path.*)$/\1:\/usr\/local\/bin:\/usr\/local\/sbin/g' /etc/sudoers
yum update -y
yum install -y gcc-c++ patch readline readline-devel zlib zlib-devel \
libyaml-devel libffi-devel openssl-devel make bzip2 autoconf \
automake libtool bison
else
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline5-dev libyaml-dev
fi
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-${RUBY_VERSION}.tar.gz
tar -xvzf ruby-${RUBY_VERSION}.tar.gz
cd ruby-${RUBY_VERSION}/
./configure --prefix=/usr/local
make
make install
/usr/local/bin/gem install chef ruby-shadow --no-ri --no-rdoc
@HelloGrayson
Copy link

Does this allow you to actually run a chef-solo cookbook/recipe/role?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment