diff options
Diffstat (limited to 'puppet/bin/dependencies')
-rwxr-xr-x | puppet/bin/dependencies | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/puppet/bin/dependencies b/puppet/bin/dependencies new file mode 100755 index 0000000..78ca659 --- /dev/null +++ b/puppet/bin/dependencies @@ -0,0 +1,28 @@ +#!/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 +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 |