mirror of
https://github.com/Telecominfraproject/wlan-cloud-ucentral-deploy.git
synced 2026-03-20 03:40:49 +00:00
14 lines
1.1 KiB
Smarty
14 lines
1.1 KiB
Smarty
{{- define "openwifi.user_creation_script_sql" -}}
|
|
{{- $root := . -}}
|
|
{{- $postgresqlBase := index .Values "postgresql" }}
|
|
{{- $postgresqlEmulatedRoot := (dict "Values" $postgresqlBase "Chart" (dict "Name" "postgresql") "Release" $.Release) }}
|
|
{{ range index .Values "postgresql" "initDbScriptSecret" "services" }}
|
|
CREATE USER {{ index $root "Values" . "configProperties" "storage.type.postgresql.username" }};
|
|
ALTER USER {{ index $root "Values" . "configProperties" "storage.type.postgresql.username" }} WITH ENCRYPTED PASSWORD '{{ index $root "Values" . "configProperties" "storage.type.postgresql.password" }}';
|
|
CREATE DATABASE {{ index $root "Values" . "configProperties" "storage.type.postgresql.database" }};
|
|
GRANT ALL PRIVILEGES ON DATABASE {{ index $root "Values" . "configProperties" "storage.type.postgresql.database" }} TO {{ index $root "Values" . "configProperties" "storage.type.postgresql.username" }};
|
|
ALTER DATABASE {{ index $root "Values" . "configProperties" "storage.type.postgresql.database" }} OWNER TO {{ index $root "Values" . "configProperties" "storage.type.postgresql.username" }};
|
|
{{ end }}
|
|
{{- end -}}
|
|
|