diff options
Diffstat (limited to 'kubernetes/policy/resources')
-rw-r--r-- | kubernetes/policy/resources/config/db-pg.sh | 7 | ||||
-rw-r--r-- | kubernetes/policy/resources/config/db_migrator_policy_init.sh | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/kubernetes/policy/resources/config/db-pg.sh b/kubernetes/policy/resources/config/db-pg.sh index 913ccc7728..a7fc088d55 100644 --- a/kubernetes/policy/resources/config/db-pg.sh +++ b/kubernetes/policy/resources/config/db-pg.sh @@ -20,10 +20,15 @@ export PGPASSWORD=${PG_ADMIN_PASSWORD}; +echo "Create user ${PG_USER} is created in Host ${PG_HOST}" psql -h ${PG_HOST} -p ${PG_PORT} -U postgres --command "CREATE USER \"${PG_USER}\" WITH PASSWORD '${PG_USER_PASSWORD}'" for db in migration pooling policyadmin policyclamp operationshistory clampacm do + echo "Create DB ${db}" psql -h ${PG_HOST} -p ${PG_PORT} -U postgres --command "CREATE DATABASE ${db};" + echo "Grant privileges to DB ${db} for user ${PG_USER}" psql -h ${PG_HOST} -p ${PG_PORT} -U postgres --command "GRANT ALL PRIVILEGES ON DATABASE ${db} TO \"${PG_USER}\";" -done
\ No newline at end of file + echo "Grant privileges to SCHEMA public for user ${PG_USER}" + psql -h ${PG_HOST} -p ${PG_PORT} -d ${db} -U postgres --command "GRANT ALL ON SCHEMA public TO \"${PG_USER}\";" +done diff --git a/kubernetes/policy/resources/config/db_migrator_policy_init.sh b/kubernetes/policy/resources/config/db_migrator_policy_init.sh index a1d8fd89ea..32ccbf18d4 100644 --- a/kubernetes/policy/resources/config/db_migrator_policy_init.sh +++ b/kubernetes/policy/resources/config/db_migrator_policy_init.sh @@ -31,4 +31,4 @@ for schema in ${SQL_DB}; do fi done -exit $rc
\ No newline at end of file +exit $rc |