-deploynode() {
- if test $NODE = localhost ; then
- sudo ./provision.sh --config local.params --roles ${NODES[$NODE]}
- else
- if ! ssh $NODE test -d arvados-setup ; then
- ssh $NODE git init --bare arvados-setup.git
- if ! git remote add $NODE $DEPLOY_USER@$NODE:arvados-setup.git ; then
- git remote set-url $NODE $DEPLOY_USER@$NODE:arvados-setup.git
- fi
- git push $NODE $BRANCH
- ssh $NODE git clone arvados-setup.git arvados-setup
- fi
+set -eu
+
+# The parameter file
+declare CONFIG_FILE=local.params
+
+# The salt template directory
+declare CONFIG_DIR=local_config_dir
+
+# The 5-character Arvados cluster id
+# This will be populated by loadconfig()
+declare CLUSTER
+
+# The parent domain (not including the cluster id)
+# This will be populated by loadconfig()
+declare DOMAIN
+
+# A bash associative array listing each node and mapping to the roles
+# that should be provisioned on those nodes.
+# This will be populated by loadconfig()
+declare -A NODES
+
+# The ssh user we'll use
+# This will be populated by loadconfig()
+declare DEPLOY_USER
+
+# The git repository that we'll push to on all the nodes
+# This will be populated by loadconfig()
+declare GITTARGET
+
+sync() {
+ local NODE=$1
+ local BRANCH=$2
+
+ # Synchronizes the configuration by creating a git repository on
+ # each node, pushing our branch, and updating the checkout.
+
+ if [[ "$NODE" != localhost ]] ; then
+ if ! ssh $NODE test -d ${GITTARGET}.git ; then