aboutsummaryrefslogtreecommitdiff
path: root/hydra
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-09-19 22:14:15 -0300
committerSilvio Rhatto <rhatto@riseup.net>2010-09-19 22:14:15 -0300
commitcf19f7ec1b0975ac24501dbd90a5bbeb56a5a2b7 (patch)
treeda9072a8d310e68598a9a441d448de606ee179f2 /hydra
downloadhydra-cf19f7ec1b0975ac24501dbd90a5bbeb56a5a2b7.tar.gz
hydra-cf19f7ec1b0975ac24501dbd90a5bbeb56a5a2b7.tar.bz2
Initial import
Diffstat (limited to 'hydra')
-rwxr-xr-xhydra64
1 files changed, 64 insertions, 0 deletions
diff --git a/hydra b/hydra
new file mode 100755
index 0000000..0f2ea06
--- /dev/null
+++ b/hydra
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# Hydra Process Command Tool.
+#
+# Copyright (C) 2010 Sarava Group - sarava at lists.riseup.net
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Affero General Public License as
+# published by the Free Software Foundation, either version 3 of the
+# License, or any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Affero General Public License for more details.
+#
+# You should have received a copy of the GNU Affero General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+
+# TODO: get all needed requirements
+function hydra_requirements {
+}
+
+# TODO: check debian version and if backports is enabled
+# TODO: check backports key signature
+function hydra_backports {
+ echo "deb http://www.backports.org/debian lenny-backports main contrib non-free" >> /etc/apt/sources.list
+ apt-get update ; apt-get install debian-backports-keyring ; apt-get update
+ apt-get -t lenny-backports install puppet puppetmaster
+}
+
+function hydra_install_puppet {
+ apt-get update
+ # TODO: use option '-t lenny-backports' if installing from backports
+ apt-get install puppet puppetmaster
+}
+
+# Initializes a new hydra from scratch
+function hydra_init {
+ hydra_backports
+ hydra_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.
+
+ puppetd --no-daemonize --debug --verbose --onetime /etc/puppet/modules/bootstrap/manifests/init.pp
+ puppetd --no-daemonize --debug --verbose
+}
+
+# Command-line parameters
+COMMAND="$1"
+BASENAME="`basename $0`"
+
+# Command-line parser
+if [ -z "$COMMAND" ]; then
+ echo "usage: $BASENAME <comman> [arguments]"
+fi
+
+# Dispatch
+hydra_requirements
+hydra_$COMMAND