From 5298a3dc1bc5e31b6734b76758e7203d679ee489 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 3 Mar 2014 13:47:08 +0000 Subject: Make Trove deployment handle new Lorry Controller Add install-files to the list of configuration extensions, on general principles. It costs nothing to have it, and is a nice way to install, say, ssh keys. In trove.configure, support the optional LORRY_CONTROLLER_MINIONS configuration key to decide how many Lorry Controller MINION instances may run at the same time. It has a default in case it is not set. Create /etc/lorry-controller/webapp.conf. This needs to have some information from the deployment, so it can't be just installed by the Lorry Controller chunk. --- trove-system-x86_64.morph | 1 + trove.configure | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/trove-system-x86_64.morph b/trove-system-x86_64.morph index c415e54d..f0ae109b 100644 --- a/trove-system-x86_64.morph +++ b/trove-system-x86_64.morph @@ -5,6 +5,7 @@ configuration-extensions: - trove-backup - fstab - simple-network +- install-files description: Trove server kind: system name: trove-system-x86_64 diff --git a/trove.configure b/trove.configure index 42ad6321..cdd37b95 100755 --- a/trove.configure +++ b/trove.configure @@ -29,6 +29,7 @@ # * TROVE_ADMIN_EMAIL # * TROVE_ADMIN_NAME # * TROVE_ADMIN_SSH_PUBKEY +# * LORRY_CONTROLLER_MINIONS (optional, defaults to 4) # # 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 @@ -66,6 +67,7 @@ s/##TROVE_COMPANY##/$TROVE_COMPANY/g s/##TROVE_LOG_PREFIX##/$TROVE_ID/g s/##ESC_PERSONAL_PREFIX##/people/g s/##PREFIX##/$TROVE_ID/g +s/##UPSTREAM_TROVE##/$UPSTREAM_TROVE/g ## The same prefix as above, only lua-pattern-escaped s/##ESC_PREFIX##/$(lua_escape "$TROVE_ID")/g EOF @@ -100,9 +102,42 @@ EOF # create a symlink in /var/www/htdocs to what will be the rsync area of # the releases repository +echo "Symlink rsync releases in htdocs" ln -s "/home/git/repos/$TROVE_ID/site/releases.git/rsync" \ "$ROOT/var/www/htdocs/releases" + +########################################################################## + +echo "Create Lorry Controller config" +install -d "$ROOT/etc/lorry-controller" +cat < "$ROOT/etc/lorry-controller/webapp.conf" +[config] +log = /home/lorry/webapp.log +log-max = 100M +log-keep = 10 +log-level = debug +statedb = /home/lorry/webapp.db +configuration-directory = /home/lorry/confgit +status-html = /home/lorry/lc-status.html +wsgi = yes +debug-port = 12765 +templates = /usr/share/lorry-controller/templates +confgit-url = ssh://git@localhost/$TROVE_ID/local-config/lorries +EOF + + +echo "Set up Lorry Controller MINIONs" +UNITS="$ROOT/usr/lib/systemd/system" +seq "${LORRY_CONTROLLER_MINIONS:-4}" | +while read i +do + ln -s "../lorry-controller-minion@.service" \ + "$UNITS/multi-user.target.wants/lorry-controller-minion@$i.service" +done + + + ########################################################################## # Configuration of trove-early-setup # -- cgit v1.2.1