Hydra Process Command Tool
==========================
+
+This suite is made of two commands:
+
+ - hydractl: issues commands in the current host.
+ - hydra: issues commands on multiple hosts.
base="`dirname $0`"
fi
- # Deal with relative or absolute link
+ # Deal with relative or absolute links
if [ "`basename $dest`" == "$dest" ]; then
export APP_BASE="$base"
else
# Common functions.
#
-# Setup environment
-hydra_set_env $*
+# Source required functions
source $APP_BASE/lib/hydra/git
source $APP_BASE/lib/hydra/misc
source $APP_BASE/lib/hydra/tmpfile
+
+# Setup environment
+hydra_set_env $*
#!/bin/bash
+#
# Register an existing hydra
-# TODO
+#
+
+CONFIG="$HOME/.hydra/config"
+HYDRA="$1"
+BASEDIR="$2"
+PUPPET="$(dirname `find $BASEDIR -name puppet.conf`)"
+
+mkdir -p `dirname $CONFIG`
+
+if grep -q -e "^$HYDRA=" $CONFIG; then
+ echo "Hydra $HYDRA already defined"
+ exit 1
+fi
+
+# Reparse basedir to force absolute folder
+BASEDIR="`cd $BASEDIR && pwd`"
+
+# Add entry
+chmod 700 $BASEDIR
+echo "$HYDRA=\"$BASEDIR\"" >> $CONFIG
#!/bin/bash
+#
+# Bootstrap a new hydra using the current host as a starting point.
+#
hydractl backports
hydractl install_puppet
mkdir -p /etc/puppet/modules
git clone git://git.sarava.org/puppet-bootstrap /etc/puppet/modules/bootstrap
-# TODO: edit /etc/puppet/modules/bootstrap/manifests/site.pp to suit your needs.
+echo "Editing /etc/puppet/modules/bootstrap/manifests/site.pp to suit your needs..."
+$EDITOR /etc/puppet/modules/bootstrap/manifests/site.pp
puppetd --no-daemonize --debug --verbose --onetime /etc/puppet/modules/bootstrap/manifests/init.pp
puppetd --no-daemonize --debug --verbose