aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rwxr-xr-xbin/dependencies8
2 files changed, 8 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 1ccf197..f3ed336 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ CWD = $(shell pwd)
REPO = git://git.sarava.org/puppet-bootstrap.git
PUPPET = FACTER_BOOTSTRAP_PATH="$(CWD)" puppet apply --confdir="$(CWD)" --modulepath=modules
-all: clean remote modules config
+all: deps clean remote modules config
deps:
bin/dependencies
diff --git a/bin/dependencies b/bin/dependencies
index c410852..7fda4fb 100755
--- a/bin/dependencies
+++ b/bin/dependencies
@@ -13,10 +13,16 @@ function provision_package {
if [ "$?" == "1" ]; then
echo "Installing package $1..."
- DEBIAN_FRONTEND=noninteractive apt-get install $1 -y
+ 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