#!/bin/bash # # Deploy configuration using puppet. # # Parameters DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." DEPLOY_DEPENDENCIES="puppet ruby-sqlite3 ruby-activerecord ruby-activerecord-deprecated-finders" # Load dependencies source $DIRNAME/dependencies # Determine hostname if [ ! -z "$1" ]; then FQDN="$1" else FQDN="`cat /etc/hostname`" fi # Check for manifest PUPPET_MANIFEST="$BASEDIR/puppet/manifests/nodes/$FQDN.pp" if [ ! -e "$PUPPET_MANIFEST" ]; then echo "file not found: $PUPPET_MANIFEST" exit 1 fi # Install dependencies source $DIRNAME/dependencies # Ensure additional dependencies are installed. for package in $DEPLOY_DEPENDENCIES; do provision_package $package done # Run puppet apply PUPPET_OPTS="--confdir=$BASEDIR/puppet --modulepath=$BASEDIR/puppet/modules" $SUDO LC_ALL=C puppet apply $PUPPET_OPTS $PUPPET_MANIFEST"