1 ##########################################################
2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: CC-BY-SA-3.0
6 # This is generic logic used by provision.sh & installer.sh scripts
8 if [[ -s ${CONFIG_FILE} && -s ${CONFIG_FILE}.secrets ]]; then
9 source ${CONFIG_FILE}.secrets
12 echo >&2 "You don't seem to have a config file with initial values."
13 echo >&2 "Please create a '${CONFIG_FILE}' & '${CONFIG_FILE}.secrets' files as described in"
14 echo >&2 " * https://doc.arvados.org/install/salt-single-host.html#single_host, or"
15 echo >&2 " * https://doc.arvados.org/install/salt-multi-host.html#multi_host_multi_hostnames"
19 USE_SSH_JUMPHOST=${USE_SSH_JUMPHOST:-}
20 DISABLED_CONTROLLER=""
21 DATABASE_POSTGRESQL_DEFAULT_VERSION=15
23 # Comma-separated list of nodes. This is used to dynamically adjust
26 for node in "${!NODES[@]}"; do
27 if [ -z "$NODELIST" ]; then
30 NODELIST="$NODELIST,$node"
34 # The mapping of roles to nodes. This is used to dynamically adjust
36 for node in "${!NODES[@]}"; do
37 roles="${NODES[$node]}"
39 # Split the comma-separated roles into an array
40 IFS=',' read -ra roles_array <<< "$roles"
42 for role in "${roles_array[@]}"; do
43 if [ -n "${ROLE2NODES[$role]:-}" ]; then
44 ROLE2NODES["$role"]="${ROLE2NODES[$role]},$node"
46 ROLE2NODES["$role"]=$node
51 # Auto-detects load-balancing mode
52 if [ -z "${ROLE2NODES['balancer']:-}" ]; then
58 # Auto-sets PG version if needed
59 if [[ -n "${ROLE2NODES['database']:-}" || "${NODELIST}" == "localhost" ]]; then
60 DATABASE_POSTGRESQL_VERSION="${DATABASE_POSTGRESQL_VERSION:-${DATABASE_POSTGRESQL_DEFAULT_VERSION}}"