Last active
December 16, 2015 06:08
-
-
Save andruby/5389159 to your computer and use it in GitHub Desktop.
Bootstrap shell script to install ruby and chef on a clean Ubuntu 12.04 ami
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
# postinstall.sh for Ubuntu 12.04 base ami | |
# Online at: https://gist.github.com/andruby/5389159 | |
# Usage: config.vm.provision :shell, :inline => "curl 'https://gist.github.com/andruby/5389159/raw' | sudo sh" | |
if hash chef-client 2>/dev/null; then | |
echo "Chef is already installed" | |
else | |
echo "Chef is not available on the system" | |
echo "Bootstrapping ruby & chef" | |
# Apt-install various things necessary for Ruby | |
apt-get -y update | |
apt-get -y install linux-headers-$(uname -r) build-essential | |
apt-get -y install zlib1g-dev libssl-dev libreadline-gplv2-dev libyaml-dev | |
apt-get clean | |
# Install Ruby from packages | |
apt-get -y install ruby1.9.1 ruby1.9.1-dev | |
# Installing chef | |
gem install chef --no-ri --no-rdoc | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment