#!/bin/bash -ex
# MUST be executed:
-# - on deleuze
+# - on fritz
# - as a user with an /etc/sudoers line
-# - member of "wheel" unix group on deleuze
+# - member of "wheel" unix group on deleuze (FIXME: TRUE?)
# - while holding tickets for a user who can 'ssh -K' to mire
# - and is a member of "wheel" on mire
# - while holding tokens for a user who is:
# - a member of system:administrator
-# - listed in 'bos listusers deleuze'
+# - listed in 'bos listusers fritz'
# - and who has been set up with Domtool admin privileges by:
# - running 'domtool-adduser $USER' while holding AFS admin tokens as
# someone who is already a Domtool admin
# Run a command on both mire and deleuze; assumes that no escaping is
# needed.
function mire_and_deleuze() {
- $*
- ssh -K mire.hcoop.net $*
+ execute_on_deleuze $*
+ execute_on_mire $*
}
-function execute_on_fritz () {
- ssh -K fritz.hcoop.net $*
+function execute_on_deleuze () {
+ ssh -K deleuze.hcoop.net $*
+}
+
+function execute_on_mire () {
+ ssh -K mire.hcoop.net $*
}
function execute_on_all_machines () {
$*
ssh -K mire.hcoop.net $*
ssh -K hopper.hcoop.net $*
- ssh -K fritz.hcoop.net $*
+ ssh -K deleuze.hcoop.net $*
}
#
ssh hopper.hcoop.net cd /etc/keytabs\; sudo tar xlpf -)
(cd /etc/keytabs
sudo tar clpf - user.daemon/$USER | \
- ssh fritz.hcoop.net cd /etc/keytabs\; sudo tar xlpf -)
+ ssh deleuze.hcoop.net cd /etc/keytabs\; sudo tar xlpf -)
#
# Create/mount/set-perms on user's volumes (home, mail, databases, logs)
chown $USER:nogroup $HOMEPATH/.public/.domtool
test -e $HOMEPATH/.domtool || \
test -L $HOMEPATH/.domtool || \
- sudo -u $USER ln -s $HOMEPATH/.public/.domtool $HOMEPATH/.domtool
+ execute_on_deleuze sudo -u $USER ln -s $HOMEPATH/.public/.domtool $HOMEPATH/.domtool
+ # ^^ work around sudo env_reset crap without having to
+ # actually figure out how to make it work cleanly -- clinton,
+ # 2011-11-30
# Gitweb hosting
test -L /var/cache/git/$USER || \
fi
# Create database tablespaces
-execute_on_fritz sudo /afs/hcoop.net/common/etc/scripts/create-user-database $USER
+sudo /afs/hcoop.net/common/etc/scripts/create-user-database $USER
#
# Mount points for backup volumes
# Domtool integration
#
-domtool-adduser $USER
+execute_on_deleuze domtool-adduser $USER
#
# Subscribe user to our mailing lists.
#
-echo $USER@hcoop.net | sudo -u list \
+echo $USER@hcoop.net | execute_on_deleuze sudo -u list \
/var/lib/mailman/bin/add_members -r - hcoop-announce