Commits

Johan Bakker committed dddda54

adjusted bootstrap script, puppet wrapper script now handles foldercreation under /data

  • Participants
  • Parent commits 430efa2

Comments (0)

Files changed (1)

bootstrap-puppet.sh

 # script : bootstrap-puppet.sh
 # Usage  : bootstrapping puppet
 # Author : Johan Bakker (jbakker@atlassian.com)
-VER=0.0.4
+VER=0.0.5
 
 usage() {
   echo "
   bootstrap-puppet.sh $VER
-  Usage: bootstrap-puppet.sh [-hy] [-CGPSW]
+  Usage: bootstrap-puppet.sh [-hy] [-CDGPSW]
      -h: print usage informations and exit
      -y: Answers all questions with yes (this applies to installing ruby and creating folders)
      -C: Config folder (default set to SOFTWARE_ROOT/etc)
+     -D: Data (requires write access!) (defaults to /data)
      -G: Rubygem version (defaults to 1.3.5)
      -P: Puppet installation folder (default set to SOFTWARE_ROOT/lib/puppet)
      -S: Set software root folder (defaults to /sw)
 	echo "#!/bin/sh
 export GEM_HOME=$PUP_DIR
 export RUBYLIB=$PUP_DIR/lib
+test -d $DATA_DIR/puppet/var && mkdir -p $DATA_DIR/puppet/var
+test -d $DATA_DIR/puppet/ssl && mkdir -p $DATA_DIR/puppet/ssl
 $PUP_DIR/bin/puppet \$* --confdir $CONF_DIR" > $WRAP_DIR/puppet
 	chmod +x $WRAP_DIR/puppet 
 	fi
 	if [ ! -f $CONF_DIR/puppet.conf ]; then
   	echo "[user]
 report = false
-reports = node
-manifestdir = $MANIFEST_DIR
-modulepath = $MODULES_DIR" > $CONF_DIR/puppet.conf
+reports = none
+vardir = $DATA_DIR/puppet/var
+ssldir = $DATA_DIR/puppet/ssl" > $CONF_DIR/puppet.conf
 	fi
 }
 
 PUP_DIR=${PUP_DIR:-"$SW_DIR/lib/puppet"}
 WRAP_DIR=${WRAP_DIR:-"$SW_DIR/bin"}
 CONF_DIR=${CONF_DIR:-"$SW_DIR/etc"}
-MANIFEST_DIR="$CONF_DIR/puppet/manifests"
-MODULES_DIR="$CONF_DIR/puppet/modules"
+DATA_DIR=${DATA_DIR:-"/data"}
 RUBYGEMS=${RUBYGEMS:-"1.3.5"}
 #set packagelist list command
 which 'rpm' &> /dev/null && pkgadd='yum -y install'