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/deploy | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 bin/deploy (limited to 'bin/deploy') diff --git a/bin/deploy b/bin/deploy new file mode 100755 index 0000000..8d296e9 --- /dev/null +++ b/bin/deploy @@ -0,0 +1,38 @@ +#!/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" -- cgit v1.2.3