diff options
author | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-03-17 14:52:22 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2014-03-17 14:52:22 +0000 |
commit | 3e47654e8daee1c4c83a1a4693627b95cb93a366 (patch) | |
tree | dc1e035df305ea71a6954b267d4495a27090f8dd | |
parent | 0d50fc299e0072cd56ac7804b54a6c137c501855 (diff) | |
parent | 3e73cebdb2ef8df99f416696d040e797b856cd24 (diff) | |
download | definitions-3e47654e8daee1c4c83a1a4693627b95cb93a366.tar.gz |
Merge branch 'baserock/sam/devel-upgrades-v2'
Reviewed-By: Richard Maw <richard.maw@codethink.co.uk>
-rwxr-xr-x | trove.configure | 15 | ||||
-rw-r--r-- | upgrade-devel.morph | 45 |
2 files changed, 56 insertions, 4 deletions
diff --git a/trove.configure b/trove.configure index a1abae97..83d57880 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 diff --git a/upgrade-devel.morph b/upgrade-devel.morph new file mode 100644 index 00000000..fc5f5b30 --- /dev/null +++ b/upgrade-devel.morph @@ -0,0 +1,45 @@ +name: upgrade-devel +kind: cluster +description: | + This is a cluster morphology that can be used to deploy systems to a + an existing Baserock devel system, as an upgrade of the running system. + + This method is for users who deployed a system manually from one of the + images provided on http://download.baserock.org. IT IS ONLY POSSIBLE TO + UPGRADE BASEROCK 14 RELEASES OR NEWER. + + If you deployed your system using `morph deploy` then you should reuse the + cluster morphology you did the initial deployment with, instead of this one, + so that the configuration is preserved in the new system. + + Ensure that your root user has passwordless SSH access to localhost with + `ssh root@localhost whoami`. If not, run `ssh-copy-id root@localhost`. + Make sure the 'morph' field below matches the system you are upgrading. + + To upgrade, fill in $HOSTNAME and $VERSION_LABEL below and run: + + morph deploy --upgrade upgrade-devel.morph + + Alternatively, you can delete those two configuration lines and run: + + morph deploy --upgrade upgrade-devel.HOSTNAME=$HOSTNAME upgrade-devel.VERSION_LABEL=$YYYY-MM-DD + + Your configuration in /etc should be propagated to the new system, but there + may be merge conflicts. Check /etc for files named '.rej' and '.orig' in the + new system, which will indicate that there are changes from the old system + that must be merged manually. You can get a nice diff from the old /etc as + follows: + + mount /dev/sda /mnt + git diff --no-index /mnt/systems/factory/run/etc /mnt/systems/$VERSION_LABEL/run/etc + + On a base system, use 'diff -r' instead of 'git diff --no-index'. It will + not be as colourful. +systems: +- morph: devel-system-x86_64-generic + deploy: + upgrade-devel: + type: ssh-rsync + location: root@localhost + HOSTNAME: $HOSTNAME + VERSION_LABEL: $YYYY-MM-DD |