Created
February 22, 2014 01:22
-
-
Save cheempz/9147122 to your computer and use it in GitHub Desktop.
This file contains 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
# adapted from the ubuntu10.04-gems.erb template included with chef 11.4.0 | |
bash -c ' | |
<%= "export http_proxy=\"#{knife_config[:bootstrap_proxy]}\"" if knife_config[:bootstrap_proxy] -%> | |
<%# need to use archive repo sources for etch -%> | |
rm /etc/apt/sources.list | |
echo "deb http://archive.debian.org/debian etch main contrib non-free" >> /etc/apt/sources.list | |
echo "deb http://archive.debian.org/debian-security etch/updates main contrib non-free" >> /etc/apt/sources.list | |
echo "deb http://archive.debian.org/debian-backports etch-backports main" >> /etc/apt/sources.list | |
<%# add backports signer key then update -%> | |
apt-key adv --keyserver pgp.mit.edu --recv EA8E8B2116BA136C && | |
apt-get update | |
if [ ! -f /usr/bin/chef-client ]; then | |
# get rid of existing ruby | |
apt-get remove -y --purge ruby ruby1.8 ruby1.8-dev libruby1.8 libopenssl-ruby libopenssl-ruby1.8 | |
# install ruby 1.8.7 from backports repo | |
apt-get install -y libruby1.8=1.8.7.72-1~bpo40+1 ruby1.8=1.8.7.72-1~bpo40+1 ruby1.8-dev=1.8.7.72-1~bpo40+1 libopenssl-ruby1.8=1.8.7.72-1~bpo40+1 rdoc ri irb build-essential wget ssl-cert curl | |
# set ruby 1.8.7 as default ruby | |
update-alternatives --install /usr/bin/ruby ruby /usr/bin/ruby1.8 100 | |
# install rubygems | |
wget <%= "--proxy=on " if knife_config[:bootstrap_proxy] %>http://production.cf.rubygems.org/rubygems/rubygems-1.8.10.tgz -O - | tar zxf - | |
(cd rubygems-1.8.10 && ruby setup.rb --no-format-executable --no-rdoc --no-ri) | |
# install chef | |
gem update --no-rdoc --no-ri | |
gem install ohai --no-rdoc --no-ri --verbose | |
gem install mime-types --no-rdoc --no-ri --verbose --version 1.25 | |
gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %> | |
fi | |
<%# ensure rsync is installed -%> | |
if ! which rsync >/dev/null; then | |
apt-get update | |
apt-get -y install rsync | |
fi | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment