#!/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