-
-
Save croaker/2427731 to your computer and use it in GitHub Desktop.
Bootstrap Chef Solo on Ubuntu or Amazon AMIs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Does this allow you to actually run a chef-solo cookbook/recipe/role?