aboutsummaryrefslogtreecommitdiff
path: root/bin/deploy
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/deploy
parent91477be1db80bd38ccc03ab38487e69dcad30b86 (diff)
downloadpuppet-bootstrap-49c44668c835013a88e067e0af588d0005fe2d01.tar.gz
puppet-bootstrap-49c44668c835013a88e067e0af588d0005fe2d01.tar.bz2
Patches, deployment code and TODO update
Diffstat (limited to 'bin/deploy')
-rwxr-xr-xbin/deploy38
1 files changed, 38 insertions, 0 deletions
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"