aboutsummaryrefslogtreecommitdiff
path: root/bin/provision
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2015-10-20 13:53:25 -0200
committerSilvio Rhatto <rhatto@riseup.net>2015-10-20 13:53:25 -0200
commit49c44668c835013a88e067e0af588d0005fe2d01 (patch)
treeec8c044891f2b1cb807c8d7590e08685347b5597 /bin/provision
parent91477be1db80bd38ccc03ab38487e69dcad30b86 (diff)
downloadpuppet-bootstrap-49c44668c835013a88e067e0af588d0005fe2d01.tar.gz
puppet-bootstrap-49c44668c835013a88e067e0af588d0005fe2d01.tar.bz2
Patches, deployment code and TODO update
Diffstat (limited to 'bin/provision')
-rwxr-xr-xbin/provision26
1 files changed, 12 insertions, 14 deletions
diff --git a/bin/provision b/bin/provision
index 8473d53..16f102f 100755
--- a/bin/provision
+++ b/bin/provision
@@ -3,16 +3,14 @@
# Simple shell provisioner for Vagrant instances.
#
-# Set sudo config
-if [ "`whoami`" != 'root' ]; then
- sudo="sudo"
-fi
+# Parameters
+DIRNAME="`dirname $0`"
-# Ensure the system is updated.
-$sudo apt-get update && DEBIAN_FRONTEND=noninteractive $sudo apt-get dist-upgrade -y && $sudo apt-get autoremove -y && $sudo apt-get clean
+# Load dependencies
+source $DIRNAME/dependencies
-# Install dependencies
-source /vagrant/puppet/bin/dependencies
+# Ensure the system is updated.
+$SUDO apt-get update && DEBIAN_FRONTEND=noninteractive $SUDO apt-get dist-upgrade -y && $SUDO apt-get autoremove -y && $SUDO apt-get clean
# Ensure additional dependencies are installed.
for package in usbutils; do
@@ -24,14 +22,14 @@ for package in ruby-sqlite3 ruby-activerecord ruby-activerecord-deprecated-finde
provision_package $package
done
-# Link hiera configuration.
+# Link hiera configuration if needed.
if [ ! -h "/etc/puppet/hiera.yaml" ]; then
- $sudo rm -f /etc/puppet/hiera.yaml
- $sudo ln -s /vagrant/puppet/hiera/hiera.yaml /etc/puppet/hiera.yaml
+ $SUDO rm -f /etc/puppet/hiera.yaml
+ $SUDO ln -s $DIRNAME/../hiera/hiera.yaml /etc/puppet/hiera.yaml
fi
-# Link puppet configuration.
+# Link puppet configuration if needed.
if [ ! -h "/etc/puppet/puppet.conf" ]; then
- $sudo rm -f /etc/puppet/puppet.conf
- $sudo ln -s /vagrant/puppet/puppet.conf /etc/puppet/puppet.conf
+ $SUDO rm -f /etc/puppet/puppet.conf
+ $SUDO ln -s $DIRNAME/../puppet.conf /etc/puppet/puppet.conf
fi