blob: 94d37654ec2fb92e1995dae7b4e9dfd3514540c6 (
plain)
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
29
30
31
32
33
34
35
36
37
|
#!/bin/bash
#
# Puppet bootstrap dependencies.
#
# Parameters
DEPENDENCIES="puppet-common git mr whois"
DEPLOY_DEPENDENCIES="ruby-sqlite3 ruby-activerecord"
# Additional non-wheezy package
if [ "`head -c 1 /etc/debian_version`" != '7' ]; then
DEPLOY_DEPENDENCIES="$DEPLOY_DEPENDENCIES ruby-activerecord-deprecated-finders"
fi
# Install a package, thanks to the Hydra Suite.
function provision_package {
if [ -z "$1" ]; then
return
fi
dpkg -s $1 &> /dev/null
if [ "$?" == "1" ]; then
echo "Installing package $1..."
DEBIAN_FRONTEND=noninteractive $SUDO apt-get install $1 -y
fi
}
# Set sudo config
if [ "`whoami`" != 'root' ]; then
SUDO="sudo"
fi
# Ensure basic packages are installed.
for package in $DEPENDENCIES; do
provision_package $package
done
|