-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
28 lines (21 loc) · 872 Bytes
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#----------------
# Taken from http://www.opinionatedprogrammer.com/2011/06/chef-solo-tutorial-managing-a-single-server-with-chef/
# license http://creativecommons.org/publicdomain/zero/1.0/
#----------------
#!/bin/bash
# This runs as root on the server
#chef_binary=/var/lib/gems/1.9.1/bin/chef-solo
chef_binary=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)
apt-get update &&
apt-get -o Dpkg::Options::="--force-confnew" \
--force-yes -fuy dist-upgrade &&
# Install Ruby and Chef
apt-get install -y ruby1.9.1 ruby1.9.1-dev make &&
sudo gem1.9.1 install --no-rdoc --no-ri chef --version 11.12.2
sudo gem1.9.1 install --no-rdoc --no-ri ruby-shadow
fi &&
"$chef_binary" -c solo.rb -j solo.json