20953: Don't make prominent the SSL cert expiration normal status.
[arvados.git] / tools / salt-install / common.sh
index 0c5dd50e6c6b99b75a3132cd0160db302adde1f2..360c2c7cc37d2cf8a75824807300cc67ac1af908 100644 (file)
@@ -16,6 +16,10 @@ else
   exit 1
 fi
 
+USE_SSH_JUMPHOST=${USE_SSH_JUMPHOST:-}
+DISABLED_CONTROLLER=""
+DATABASE_POSTGRESQL_DEFAULT_VERSION=15
+
 # Comma-separated list of nodes. This is used to dynamically adjust
 # salt pillars.
 NODELIST=""
@@ -44,9 +48,22 @@ for node in "${!NODES[@]}"; do
   done
 done
 
+# Sets TLS certificate expiration thresholds
+TLS_EXPIRATION_YELLOW=5184000 # > 2 months
+TLS_EXPIRATION_GREEN=15552000 # > 6 months
+if [[ "${SSL_MODE}" == "lets-encrypt" ]]; then
+  TLS_EXPIRATION_YELLOW=2592000 # > 1 months
+  TLS_EXPIRATION_GREEN=5184000 # > 2 months
+fi
+
 # Auto-detects load-balancing mode
 if [ -z "${ROLE2NODES['balancer']:-}" ]; then
   ENABLE_BALANCER="no"
 else
   ENABLE_BALANCER="yes"
 fi
+
+# Auto-sets PG version if needed
+if [[ -n "${ROLE2NODES['database']:-}" || "${NODELIST}" == "localhost" ]]; then
+  DATABASE_POSTGRESQL_VERSION="${DATABASE_POSTGRESQL_VERSION:-${DATABASE_POSTGRESQL_DEFAULT_VERSION}}"
+fi
\ No newline at end of file