aboutsummaryrefslogtreecommitdiff
path: root/bin/dependencies
blob: 7fda4fb4ce07992c4a1f45bc1cd4c4702cde226f (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
#!/bin/bash
#
# Simple shell provisioner for Vagrant instances.
#

# 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
local sudo device rsync
if [ "`whoami`" != 'root' ]; then
  sudo="sudo"
fi

# Ensure basic packages are installed.
for package in puppet ruby-hiera-puppet mr whois; do
  provision_package $package
done