From 49c44668c835013a88e067e0af588d0005fe2d01 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 20 Oct 2015 13:53:25 -0200 Subject: Patches, deployment code and TODO update --- bin/provision | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'bin/provision') 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 -- cgit v1.2.3