summaryrefslogtreecommitdiff
path: root/puppet/bin/dependencies
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/bin/dependencies')
-rwxr-xr-xpuppet/bin/dependencies33
1 files changed, 25 insertions, 8 deletions
diff --git a/puppet/bin/dependencies b/puppet/bin/dependencies
index 507145b..4330730 100755
--- a/puppet/bin/dependencies
+++ b/puppet/bin/dependencies
@@ -3,6 +3,26 @@
# Puppet bootstrap dependencies.
#
+# Parameters
+BASENAME="`basename $0`"
+DEPLOY_DEPENDENCIES="rsync puppet-common hiera-eyaml"
+DEVELOP_DEPENDENCIES="git mr whois hiera-eyaml"
+
+# Additional wheezy dependencies if not using puppet-common from wheezy-backports
+#if [ "`head -c 1 /etc/debian_version`" == '7' ]; then
+# DEPLOY_DEPENDENCIES="$DEPLOY_DEPENDENCIES ruby-hiera-puppet"
+#fi
+
+# Set sudo config
+if [ "`whoami`" != 'root' ]; then
+ SUDO="sudo"
+
+ if ! sudo -n true; then
+ echo "Please set passwordless sudo."
+ exit 1
+ fi
+fi
+
# Install a package, thanks to the Hydra Suite.
function provision_package {
if [ -z "$1" ]; then
@@ -17,12 +37,9 @@ function provision_package {
fi
}
-# Set sudo config
-if [ "`whoami`" != 'root' ]; then
- SUDO="sudo"
-fi
-
# Ensure basic packages are installed.
-for package in puppet git mr whois; do
- provision_package $package
-done
+if [ "$BASENAME" == "dependencies" ]; then
+ for package in $DEVELOP_DEPENDENCIES; do
+ provision_package $package
+ done
+fi