From cf19f7ec1b0975ac24501dbd90a5bbeb56a5a2b7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 19 Sep 2010 22:14:15 -0300 Subject: Initial import --- hydra | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 hydra (limited to 'hydra') 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 . +# + +# 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 [arguments]" +fi + +# Dispatch +hydra_requirements +hydra_$COMMAND -- cgit v1.2.3