summaryrefslogtreecommitdiffstats
path: root/kubernetes/sdnc/resources/config/bin/installSdncDb.sh
diff options
context:
space:
mode:
authorjmac <james.macnider@amdocs.com>2018-04-07 03:46:12 +0000
committerjmac <james.macnider@amdocs.com>2018-04-07 03:48:18 +0000
commitbc92d13598938ad2abcd0a89b4c08b2f6500488e (patch)
tree75817a74bee13821afa7aa96574b676fa1ad8195 /kubernetes/sdnc/resources/config/bin/installSdncDb.sh
parentdc4a88493697af864298eda18895c7af50f4de0a (diff)
Ensure sdnctl user/schema created on master MySQL
Change-Id: I5507d23ff62c9d5d5d19f86374ea91ccea2e95a9 Signed-off-by: jmac <james.macnider@amdocs.com> Issue-ID: OOM-887
Diffstat (limited to 'kubernetes/sdnc/resources/config/bin/installSdncDb.sh')
-rw-r--r--kubernetes/sdnc/resources/config/bin/installSdncDb.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/kubernetes/sdnc/resources/config/bin/installSdncDb.sh b/kubernetes/sdnc/resources/config/bin/installSdncDb.sh
index f2c133cdc1..e574bd7aec 100644
--- a/kubernetes/sdnc/resources/config/bin/installSdncDb.sh
+++ b/kubernetes/sdnc/resources/config/bin/installSdncDb.sh
@@ -22,7 +22,8 @@
###
SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc}
-MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0}
+MYSQL_HOST=${MYSQL_HOST:-{{.Release.Name}}-{{.Values.mysql.nameOverride}}-0.{{.Values.mysql.service.name}}.{{.Release.Namespace}}}
+MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}}
SDNC_DB_USER=${SDNC_DB_USER:-sdnctl}
SDNC_DB_PASSWD=${SDNC_DB_PASSWD:-gamma}
@@ -30,7 +31,7 @@ SDNC_DB_DATABASE=${SDN_DB_DATABASE:-sdnctl}
# Create tablespace and user account
-mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} mysql <<-END
+mysql -h ${MYSQL_HOST} -u root -p${MYSQL_PASSWD} mysql <<-END
CREATE DATABASE ${SDNC_DB_DATABASE};
CREATE USER '${SDNC_DB_USER}'@'localhost' IDENTIFIED BY '${SDNC_DB_PASSWD}';
CREATE USER '${SDNC_DB_USER}'@'%' IDENTIFIED BY '${SDNC_DB_PASSWD}';
@@ -42,12 +43,12 @@ END
# load schema
if [ -f ${SDNC_HOME}/data/sdnctl.dump ]
then
- mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < ${SDNC_HOME}/data/sdnctl.dump
+ mysql -h ${MYSQL_HOST} -u root -p${MYSQL_PASSWD} sdnctl < ${SDNC_HOME}/data/sdnctl.dump
fi
for datafile in ${SDNC_HOME}/data/*.data.dump
do
- mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < $datafile
+ mysql -h ${MYSQL_HOST} -u root -p${MYSQL_PASSWD} sdnctl < $datafile
done
# Create VNIs 100-199