@@ -33,29 +33,25 @@ export SYSTEM_DOMAIN="autoscaler.app-runtime-interfaces.ci.cloudfoundry.org"
3333export CPU_LOWER_THRESHOLD=" ${CPU_LOWER_THRESHOLD:- " 100" } "
3434
3535generate_deployment_secrets () {
36- local prefix=" /bosh-autoscaler/${DEPLOYMENT_NAME} "
37- credhub generate --no-overwrite -n " ${prefix} /autoscaler_metricsforwarder_health_password" --length 16 -t password
38- credhub generate --no-overwrite -n " ${prefix} /autoscaler_metricsgateway_health_password" --length 16 -t password
39- credhub generate --no-overwrite -n " ${prefix} /autoscaler_operator_health_password" --length 16 -t password
40- credhub generate --no-overwrite -n " ${prefix} /autoscaler_eventgenerator_health_password" --length 16 -t password
41- credhub generate --no-overwrite -n " ${prefix} /autoscaler_scalingengine_health_password" --length 16 -t password
42- credhub generate --no-overwrite -n " ${prefix} /service_broker_password_blue" --length 16 -t password
43- credhub generate --no-overwrite -n " ${prefix} /service_broker_password" --length 16 -t password
44- return
36+ METRICSFORWARDER_HEALTH_PASSWORD=" $( openssl rand -base64 12) "
37+ METRICSGATEWAY_HEALTH_PASSWORD=" $( openssl rand -base64 12) "
38+ OPERATOR_HEALTH_PASSWORD=" $( openssl rand -base64 12) "
39+ EVENTGENERATOR_HEALTH_PASSWORD=" $( openssl rand -base64 12) "
40+ SCALINGENGINE_HEALTH_PASSWORD=" $( openssl rand -base64 12) "
41+ SERVICE_BROKER_PASSWORD_BLUE=" $( openssl rand -base64 12) "
42+ SERVICE_BROKER_PASSWORD=" $( openssl rand -base64 12) "
43+ export METRICSFORWARDER_HEALTH_PASSWORD METRICSGATEWAY_HEALTH_PASSWORD
44+ export OPERATOR_HEALTH_PASSWORD EVENTGENERATOR_HEALTH_PASSWORD
45+ export SCALINGENGINE_HEALTH_PASSWORD SERVICE_BROKER_PASSWORD_BLUE SERVICE_BROKER_PASSWORD
4546}
4647
4748load_secrets () {
4849 local secrets_file=" $1 "
4950 # Map YAML keys → shell variable names, emitting `export VAR=value` lines
5051 local exports
5152 exports=" $( yq '
52- "export EVENTGENERATOR_HEALTH_PASSWORD=" + (.eventgenerator_health_password | @sh),
5353 "export EVENTGENERATOR_LOG_CACHE_UAA_CLIENT_ID=" + (.eventgenerator_log_cache_uaa_client_id | @sh),
5454 "export EVENTGENERATOR_LOG_CACHE_UAA_CLIENT_SECRET=" + (.eventgenerator_log_cache_uaa_client_secret | @sh),
55- "export METRICSFORWARDER_HEALTH_PASSWORD=" + (.metricsforwarder_health_password | @sh),
56- "export METRICSGATEWAY_HEALTH_PASSWORD=" + (.metricsgateway_health_password | @sh),
57- "export SCALINGENGINE_HEALTH_PASSWORD=" + (.scalingengine_health_password | @sh),
58- "export OPERATOR_HEALTH_PASSWORD=" + (.operator_health_password | @sh),
5955 "export CF_ADMIN_PASSWORD=" + (.cf_admin_password | @sh),
6056 "export POSTGRES_IP=" + (.postgres_ip | @sh),
6157 "export DATABASE_DB_USERNAME=" + (.database_username | @sh),
@@ -65,10 +61,7 @@ load_secrets() {
6561 "export DATABASE_DB_CLIENT_KEY=" + (.database_client_key | @sh),
6662 "export SYSLOG_CLIENT_CA=" + (.syslog_client_ca | @sh),
6763 "export SYSLOG_CLIENT_CERT=" + (.syslog_client_cert | @sh),
68- "export SYSLOG_CLIENT_KEY=" + (.syslog_client_key | @sh),
69- "export SERVICE_BROKER_PASSWORD_BLUE=" + (.service_broker_password_blue | @sh),
70- "export SERVICE_BROKER_PASSWORD=" + (.service_broker_password | @sh),
71- "export AUTOSCALER_OTHER_USER_PASSWORD=" + (.other_user_password | @sh)
64+ "export SYSLOG_CLIENT_KEY=" + (.syslog_client_key | @sh)
7265 ' " ${secrets_file} " ) "
7366 eval " ${exports} "
7467 return
@@ -95,14 +88,6 @@ database_server_ca: ((/bosh-autoscaler/postgres/postgres_server.ca))
9588database_client_cert: ((/bosh-autoscaler/postgres/postgres_server.certificate))
9689database_client_key: ((/bosh-autoscaler/postgres/postgres_server.private_key))
9790
98- metricsforwarder_health_password: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /autoscaler_metricsforwarder_health_password))
99- metricsgateway_health_password: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /autoscaler_metricsgateway_health_password))
100- operator_health_password: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /autoscaler_operator_health_password))
101- eventgenerator_health_password: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /autoscaler_eventgenerator_health_password))
102- scalingengine_health_password: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /autoscaler_scalingengine_health_password))
103- service_broker_password_blue: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /service_broker_password_blue))
104- service_broker_password: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /service_broker_password))
105-
10691cf_admin_password: ((/bosh-autoscaler/cf/cf_admin_password))
10792other_user_password: ((/bosh-autoscaler/${DEPLOYMENT_NAME} /other_user_password))
10893EOF
0 commit comments