summaryrefslogtreecommitdiff
path: root/puppet/bin/dependencies
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-10-23 19:43:47 -0200
committerSilvio Rhatto <rhatto@riseup.net>2017-10-23 19:43:47 -0200
commitb45c60df8af294fe97b8912a0b9703c76e5de8d6 (patch)
tree2a3442f2e0b3c7494cc591ac8c8053d84c3c9d84 /puppet/bin/dependencies
parentc880b15f013c6d761e4632570112f796ffc1dcda (diff)
parent1bfffe2e0adff6e44ec33726988b64f95ea2f599 (diff)
downloaddebian-b45c60df8af294fe97b8912a0b9703c76e5de8d6.tar.gz
debian-b45c60df8af294fe97b8912a0b9703c76e5de8d6.tar.bz2
Merge commit '1bfffe2e0adff6e44ec33726988b64f95ea2f599' into develop
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