20926: Requires manually setting PG version when not using the 'database' role.
[arvados.git] / tools / salt-install / common.sh
index d406f2ff60ab70522fc8f101d4c76f30ea17c15a..a1201fe369043a0bf78680551873e00594adc847 100644 (file)
@@ -16,6 +16,10 @@ else
   exit 1
 fi
 
+USE_SSH_JUMPHOST=${USE_SSH_JUMPHOST:-}
+DISABLED_CONTROLLER=""
+DATABASE_POSTGRESQL_DEFAULT_VERSION=12
+
 # Comma-separated list of nodes. This is used to dynamically adjust
 # salt pillars.
 NODELIST=""
@@ -29,7 +33,6 @@ done
 
 # The mapping of roles to nodes. This is used to dynamically adjust
 # salt pillars.
-declare -A ROLE2NODES
 for node in "${!NODES[@]}"; do
   roles="${NODES[$node]}"
 
@@ -51,3 +54,8 @@ if [ -z "${ROLE2NODES['balancer']:-}" ]; then
 else
   ENABLE_BALANCER="yes"
 fi
+
+# Auto-sets PG version if needed
+if [ -n "${ROLE2NODES['database']:-}" ]; then
+  DATABASE_POSTGRESQL_VERSION="${DATABASE_POSTGRESQL_VERSION:-${DATABASE_POSTGRESQL_DEFAULT_VERSION}}"
+fi
\ No newline at end of file