20610: Removes the need to manually set up the ENABLE_BALANCER variable.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 28 Jul 2023 13:48:40 +0000 (10:48 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Fri, 28 Jul 2023 13:48:40 +0000 (10:48 -0300)
Having the role->nodes map allows us to simplify manual configuration.

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/local.params.example.multiple_hosts
tools/salt-install/provision.sh

index b70ad747a942ee2a355dbd7b0a6f7cd47406c3dd..2b4276e293bec4210d86f496aa4f5878ab89b357 100644 (file)
@@ -131,6 +131,13 @@ for node in "${!NODES[@]}"; do
   done
 done
 
+# Auto-detects load-balancing mode
+if [ -z "${ROLES['balancer']:-}" ]; then
+  ENABLE_BALANCER="no"
+else
+  ENABLE_BALANCER="yes"
+fi
+
 # Host SSL port where you want to point your browser to access Arvados
 # Defaults to 443 for regular runs, and to 8443 when called in Vagrant.
 # You can point it to another port if desired
@@ -164,7 +171,6 @@ KEEPSTORE0_INT_IP=10.1.2.13
 SHELL_INT_IP=10.1.2.17
 
 # Load balancing settings
-ENABLE_BALANCER="no"
 DISABLED_CONTROLLER=""
 
 # Performance tuning parameters
index 09edaa05ffa0d8adc74c3d8140701d0f39fad9a5..0937d3a297e5b27dd6a9c6182118e36670952d51 100755 (executable)
@@ -881,9 +881,9 @@ else
           grep -q "letsencrypt"     ${P_DIR}/top.sls || echo "    - letsencrypt" >> ${P_DIR}/top.sls
 
           grep -q "letsencrypt_${R}_configuration" ${P_DIR}/top.sls || echo "    - letsencrypt_${R}_configuration" >> ${P_DIR}/top.sls
-          sed -i "s/__CERT_REQUIRES__/cmd: create-initial-cert-${ROLES["balancer"]}*/g;
-                  s#__CERT_PEM__#/etc/letsencrypt/live/${ROLES["balancer"]}/fullchain.pem#g;
-                  s#__CERT_KEY__#/etc/letsencrypt/live/${ROLES["balancer"]}/privkey.pem#g" \
+          sed -i "s/__CERT_REQUIRES__/cmd: create-initial-cert-${ROLES['balancer']}*/g;
+                  s#__CERT_PEM__#/etc/letsencrypt/live/${ROLES['balancer']}/fullchain.pem#g;
+                  s#__CERT_KEY__#/etc/letsencrypt/live/${ROLES['balancer']}/privkey.pem#g" \
           ${P_DIR}/nginx_${R}_configuration.sls
 
           if [ "${USE_LETSENCRYPT_ROUTE53}" = "yes" ]; then