20889: Allows customization on database name and user.
authorLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 24 Aug 2023 21:47:26 +0000 (18:47 -0300)
committerLucas Di Pentima <lucas.dipentima@curii.com>
Thu, 24 Aug 2023 21:54:10 +0000 (18:54 -0300)
Also, allows specifying external PG service for the single host cases.

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

tools/salt-install/config_examples/multi_host/aws/pillars/arvados.sls
tools/salt-install/config_examples/single_host/multiple_hostnames/pillars/arvados.sls
tools/salt-install/config_examples/single_host/single_hostname/pillars/arvados.sls
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
tools/salt-install/provision.sh

index 5fe2c0a6e9c53e11ee2d2cc8678ab0db0a31dce1..84df363c2e645c594e25378a7de3fe187dcb2069 100644 (file)
@@ -7,6 +7,9 @@
 {%- set max_workers = [_workers, 8]|max %}
 {%- set max_reqs = ("__CONTROLLER_MAX_QUEUED_REQUESTS__" or 128)|int %}
 {%- set database_host = ("__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__" or "__DATABASE_INT_IP__") %}
+{%- set database_name = "__DATABASE_NAME__" %}
+{%- set database_user = "__DATABASE_USER__" %}
+{%- set database_password = "__DATABASE_PASSWORD__" %}
 
 # The variables commented out are the default values that the formula uses.
 # The uncommented values are REQUIRED values. If you don't set them, running
@@ -73,10 +76,10 @@ arvados:
     database:
       # max concurrent connections per arvados server daemon
       # connection_pool_max: 32
-      name: __CLUSTER___arvados
+      name: {{ database_name }}
       host: {{ database_host }}
-      password: "__DATABASE_PASSWORD__"
-      user: __CLUSTER___arvados
+      password: {{ database_password }}
+      user: {{ database_user }}
       encoding: en_US.utf8
       client_encoding: UTF8
 
index 35544730ad633ef8fd209acd77099eefcb421860..5883f192415f81167eee25695978ac41549a29df 100644 (file)
@@ -5,6 +5,11 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+{%- set database_host = ("__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__" or "127.0.0.1") %}
+{%- set database_name = "__DATABASE_NAME__" %}
+{%- set database_user = "__DATABASE_USER__" %}
+{%- set database_password = "__DATABASE_PASSWORD__" %}
+
 # The variables commented out are the default values that the formula uses.
 # The uncommented values are REQUIRED values. If you don't set them, running
 # this formula will fail.
@@ -65,10 +70,10 @@ arvados:
     database:
       # max concurrent connections per arvados server daemon
       # connection_pool_max: 32
-      name: __CLUSTER___arvados
-      host: 127.0.0.1
-      password: "__DATABASE_PASSWORD__"
-      user: __CLUSTER___arvados
+      name: {{ database_name }}
+      host: {{ database_host }}
+      password: {{ database_password }}
+      user: {{ database_user }}
       extra_conn_params:
         client_encoding: UTF8
       # Centos7 does not enable SSL by default, so we disable
index 10a9b79c9494d37a65c7dd66c2637c84c2a79516..e85b709c2c37aad43a9c2bda22af1973a6a4359f 100644 (file)
@@ -5,6 +5,11 @@
 #
 # SPDX-License-Identifier: AGPL-3.0
 
+{%- set database_host = ("__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__" or "127.0.0.1") %}
+{%- set database_name = "__DATABASE_NAME__" %}
+{%- set database_user = "__DATABASE_USER__" %}
+{%- set database_password = "__DATABASE_PASSWORD__" %}
+
 # The variables commented out are the default values that the formula uses.
 # The uncommented values are REQUIRED values. If you don't set them, running
 # this formula will fail.
@@ -65,10 +70,10 @@ arvados:
     database:
       # max concurrent connections per arvados server daemon
       # connection_pool_max: 32
-      name: __CLUSTER___arvados
-      host: 127.0.0.1
-      password: "__DATABASE_PASSWORD__"
-      user: __CLUSTER___arvados
+      name: {{ database_name }}
+      host: {{ database_host }}
+      password: {{ database_password }}
+      user: {{ database_user }}
       extra_conn_params:
         client_encoding: UTF8
       # Centos7 does not enable SSL by default, so we disable
index 63a51f77312668acff9790a284ea6bae9b7f9152..0cfae3e28452cedaccde65bcbfa11f3fc496d214 100644 (file)
@@ -141,6 +141,8 @@ KEEP_INT_IP=${WORKBENCH1_INT_IP}
 KEEPSTORE0_INT_IP=10.1.2.13
 SHELL_INT_IP=10.1.2.17
 
+DATABASE_NAME="${CLUSTER}_arvados"
+DATABASE_USER="${CLUSTER}_arvados"
 # Set this if using an external PostgreSQL service.
 #DATABASE_EXTERNAL_SERVICE_HOST_OR_IP=
 
index 551051939e37e6cbe8ae601c7fe92774b83a0c70..54da585d387dee21ca6d5ccce5ac1e6961513bda 100644 (file)
@@ -76,6 +76,11 @@ KEEP_INT_IP=""
 KEEPSTORE0_INT_IP=""
 SHELL_INT_IP=""
 
+DATABASE_NAME="${CLUSTER}_arvados"
+DATABASE_USER="${CLUSTER}_arvados"
+# Set this if using an external PostgreSQL service.
+#DATABASE_EXTERNAL_SERVICE_HOST_OR_IP=
+
 # The directory to check for the config files (pillars, states) you want to use.
 # There are a few examples under 'config_examples'.
 # CONFIG_DIR="local_config_dir"
index ab0ee1be1bc3b55b482cc6ef39af23b153f63c34..d42b4cb54cb80b690cbf6c5858e3c9f4e2835520 100644 (file)
@@ -86,6 +86,11 @@ KEEP_INT_IP=""
 KEEPSTORE0_INT_IP=""
 SHELL_INT_IP=""
 
+DATABASE_NAME="${CLUSTER}_arvados"
+DATABASE_USER="${CLUSTER}_arvados"
+# Set this if using an external PostgreSQL service.
+#DATABASE_EXTERNAL_SERVICE_HOST_OR_IP=
+
 # The directory to check for the config files (pillars, states) you want to use.
 # There are a few examples under 'config_examples'.
 # CONFIG_DIR="local_config_dir"
index e76d3cc6baddf7332c210db03ed3129e600b8c04..b44fc8b19ba27834acdca944bf78790d6a2af9d2 100755 (executable)
@@ -175,7 +175,11 @@ apply_var_substitutions() {
        s#__LE_AWS_REGION__#${LE_AWS_REGION:-}#g;
        s#__LE_AWS_SECRET_ACCESS_KEY__#${LE_AWS_SECRET_ACCESS_KEY:-}#g;
        s#__LE_AWS_ACCESS_KEY_ID__#${LE_AWS_ACCESS_KEY_ID:-}#g;
+       s#__DATABASE_NAME__#${DATABASE_NAME}#g;
+       s#__DATABASE_USER__#${DATABASE_USER}#g;
        s#__DATABASE_PASSWORD__#${DATABASE_PASSWORD}#g;
+       s#__DATABASE_INT_IP__#${DATABASE_INT_IP:-}#g;
+       s#__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__#${DATABASE_EXTERNAL_SERVICE_HOST_OR_IP:-}#g;
        s#__KEEPWEB_EXT_SSL_PORT__#${KEEPWEB_EXT_SSL_PORT}#g;
        s#__KEEP_EXT_SSL_PORT__#${KEEP_EXT_SSL_PORT}#g;
        s#__MANAGEMENT_TOKEN__#${MANAGEMENT_TOKEN}#g;
@@ -196,8 +200,6 @@ apply_var_substitutions() {
        s#__SHELL_INT_IP__#${SHELL_INT_IP}#g;
        s#__WORKBENCH1_INT_IP__#${WORKBENCH1_INT_IP}#g;
        s#__WORKBENCH2_INT_IP__#${WORKBENCH2_INT_IP}#g;
-       s#__DATABASE_INT_IP__#${DATABASE_INT_IP:-}#g;
-       s#__DATABASE_EXTERNAL_SERVICE_HOST_OR_IP__#${DATABASE_EXTERNAL_SERVICE_HOST_OR_IP:-}#g;
        s#__WORKBENCH_SECRET_KEY__#${WORKBENCH_SECRET_KEY}#g;
        s#__SSL_KEY_ENCRYPTED__#${SSL_KEY_ENCRYPTED}#g;
        s#__SSL_KEY_AWS_REGION__#${SSL_KEY_AWS_REGION:-}#g;