summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-03-14 17:15:28 (GMT)
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-03-14 17:15:28 (GMT)
commit3e73cebdb2ef8df99f416696d040e797b856cd24 (patch)
tree83d4ac0a715e5d1417ee711544ef900a254a263e
parent5c3cbd96b2d69b77909c4817e7c73dd3060f7f81 (diff)
downloaddefinitions-3e73cebdb2ef8df99f416696d040e797b856cd24.tar.gz
trove: Allow TROVE_HOSTNAME different to TROVE_ID
This is necessary for git.baserock.org, whose TROVE_PREFIX and TROVE_ID is 'baserock' but whose hostname certainly isn't.
-rwxr-xr-xtrove.configure15
1 files changed, 11 insertions, 4 deletions
diff --git a/trove.configure b/trove.configure
index a1abae9..83d5788 100755
--- a/trove.configure
+++ b/trove.configure
@@ -30,6 +30,9 @@
# * TROVE_ADMIN_NAME
# * TROVE_ADMIN_SSH_PUBKEY
#
+# Optionally, you can specify 'TROVE_HOSTNAME' as well. If not set, this
+# defaults to the same as 'TROVE_ID'.
+#
# The configuration of a Trove is slightly tricky: part of it has to
# be run on the configured system after it has booted. We accomplish
# this by copying in all the relevant data to the target system
@@ -41,12 +44,16 @@ set -e
ROOT="$1"
+if [ -z "$TROVE_HOSTNAME" ]; then
+ TROVE_HOSTNAME="$TROVE_ID"
+fi
+
##########################################################################
# Configuration in /etc, which we need to do on all deployments.
##########################################################################
-echo "Set hostname to $TROVE_ID"
-echo "$TROVE_ID" > "$ROOT/etc/hostname"
+echo "Set hostname to $TROVE_HOSTNAME"
+echo "$TROVE_HOSTNAME" > "$ROOT/etc/hostname"
##########################################################################
@@ -58,10 +65,10 @@ lua_escape()
echo "Creating /etc/trove-setup.sed"
cat <<EOF > "$ROOT"/etc/trove-setup.sed
-s/##TROVE_HOSTNAME##/$TROVE_ID/g
+s/##TROVE_HOSTNAME##/$TROVE_HOSTNAME/g
s/##MASON_HOST##/$MASON_ID/g
s/##MASON_PORT##/18755/g
-s/##TROVE_TITLE##/$TROVE_ID/g
+s/##TROVE_TITLE##/$TROVE_HOSTNAME/g
s/##TROVE_COMPANY##/$TROVE_COMPANY/g
s/##TROVE_LOG_PREFIX##/$TROVE_ID/g
s/##ESC_PERSONAL_PREFIX##/people/g