#!/bin/bash # # genome-repo-bootstrap: Starts genome-repo bootstrap process # # chkconfig: 35 99 95 # # description: Bootstrap an Genome Repository. This can safely be run multiple times. # LOG=/var/log/genome-repo-bootstrap.log # Source function library. . /etc/init.d/functions [ -z "$HOME" ] && export HOME=/ case "$1" in start) /usr/bin/puppet --logdest=syslog /etc/genome/bootstrap.pp # If this is a respin machine, try to automatically configure it if [ -e /etc/sysconfig/genome-quickstart ]; then # Create a working directory for the sync mkdir /tmp/sync >> $LOG pushd /tmp/sync >> $LOG # Sync from the public Genome repositories git clone git://git.fedorahosted.org/git/genome >> $LOG pushd genome >> $LOG git submodule init >> $LOG git submodule update >> $LOG popd >> $LOG chown -R genome:genome /tmp/sync/genome >> $LOG pushd genome >> $LOG # Update the current machine with the public contents su - genome -c "genome-sync save --workingdir='/tmp/sync/genome'" >> $LOG # Prime cobbler with the default profile cp tools/genome-respin/cobbler/Fedora-`uname -i`.profiles /var/lib/cobbler/profiles # Prime cobbler with the default repos cp tools/genome-respin/cobbler/Fedora-`uname -i`.repos /var/lib/cobbler/repos # Bounce the puppetmaster. Seems that the repo_extensions are not getting processed after genome-sync service puppetmaster restart popd >> $LOG popd >> $LOG # Remove the file so this only runs once /bin/rm -f /etc/sysconfig/genome-quickstart fi RETVAL=$? if [ "$RETVAL" -eq 0 ]; then action "" /bin/true else action "" /bin/false fi exit 0 ;; *) echo $"Usage: $0 {start}" RETVAL=1 esac exit $RETVAL