20926: Requires manually setting PG version when not using the 'database' role.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 13 Sep 2023 22:27:13 +0000 (19:27 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Wed, 13 Sep 2023 22:27:13 +0000 (19:27 -0300)
Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas.dipentima@curii.com>

tools/salt-install/common.sh
tools/salt-install/installer.sh
tools/salt-install/local.params.example.multiple_hosts
tools/salt-install/local.params.example.single_host_multiple_hostnames
tools/salt-install/local.params.example.single_host_single_hostname

index 7036e116c94b9df2e88421b4807a87443eee0196..a1201fe369043a0bf78680551873e00594adc847 100644 (file)
@@ -18,6 +18,7 @@ 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.
@@ -53,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
index d41c50e8c511751fa5d1e26ad8d18f06b888ddf2..bb57666da6c02eaf1fece49dd90c41b1a3cc06c4 100755 (executable)
@@ -297,6 +297,12 @@ deploy)
     exit 1
   fi
 
+  if [[ -z "${DATABASE_POSTGRESQL_VERSION:-}" ]]; then
+    echo
+    echo "Please configure DATABASE_POSTGRESQL_VERSION in local.params: It should match the version of the PostgreSQL service you're going to use."
+    exit 1
+  fi
+
   if [[ ${SSL_MODE} == "bring-your-own" ]]; then
     if [[ ! -z "${ROLE2NODES['balancer']:-}" ]]; then
       checkcert balancer
index e84b8d6c13822481aa2a1abba9a5303b0839fe8f..909c3354ec15d88ce97328ed148a20e1895c581a 100644 (file)
@@ -143,9 +143,9 @@ SHELL_INT_IP=10.1.2.17
 
 DATABASE_NAME="${CLUSTER}_arvados"
 DATABASE_USER="${CLUSTER}_arvados"
-DATABASE_POSTGRESQL_VERSION=12
-# Set this if using an external PostgreSQL service.
+# Set these if using an external PostgreSQL service.
 #DATABASE_EXTERNAL_SERVICE_HOST_OR_IP=
+#DATABASE_POSTGRESQL_VERSION=
 
 # Performance tuning parameters.  If these are not set, workers
 # defaults on the number of cpus and queued requests defaults to 128.
index d5273c0c1183f33bb8e0a36acbec7365623a2e04..8dece2b76f689eaf8906e8ce361b3dceb529acd2 100644 (file)
@@ -78,9 +78,9 @@ SHELL_INT_IP=""
 
 DATABASE_NAME="${CLUSTER}_arvados"
 DATABASE_USER="${CLUSTER}_arvados"
-DATABASE_POSTGRESQL_VERSION=12
-# Set this if using an external PostgreSQL service.
+# Set these if using an external PostgreSQL service.
 #DATABASE_EXTERNAL_SERVICE_HOST_OR_IP=
+#DATABASE_POSTGRESQL_VERSION=
 
 # The directory to check for the config files (pillars, states) you want to use.
 # There are a few examples under 'config_examples'.
index 5d4dc12a12681bbe84f51a25a3313319b12b2723..33be542a15758952bb3be5e607942a3b515154e6 100644 (file)
@@ -88,9 +88,9 @@ SHELL_INT_IP=""
 
 DATABASE_NAME="${CLUSTER}_arvados"
 DATABASE_USER="${CLUSTER}_arvados"
-DATABASE_POSTGRESQL_VERSION=12
-# Set this if using an external PostgreSQL service.
+# Set these if using an external PostgreSQL service.
 #DATABASE_EXTERNAL_SERVICE_HOST_OR_IP=
+#DATABASE_POSTGRESQL_VERSION=
 
 # The directory to check for the config files (pillars, states) you want to use.
 # There are a few examples under 'config_examples'.