summaryrefslogtreecommitdiff
path: root/puppet/bin/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/bin/dependencies')
-rwxr-xr-xpuppet/bin/dependencies28
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