generate database passwod if one is not provided

This commit is contained in:
Lars Kellogg-Stedman 2014-09-18 16:32:41 -04:00
parent 174c301ede
commit 2b686c5ffd

View File

@ -1,12 +1,15 @@
#!/bin/bash
: ${KEYSTONE_DB_PASSWORD:=keystone}
: ${KEYSTONE_ADMIN_PASSWORD:=redhat}
if ! [ "$KEYSTONE_ADMIN_TOKEN" ]; then
KEYSTONE_ADMIN_TOKEN=$(openssl rand -hex 15)
fi
if ! [ "$KEYSTONE_DB_PASSWORD" ]; then
KEYSTONE_DB_PASSWORD=$(openssl rand -hex 15)
fi
mysql -h ${MARIADBMASTER_PORT_3306_TCP_ADDR} -u root -p${DB_ROOT_PASSWORD} mysql <<EOF
CREATE DATABASE IF NOT EXISTS keystone;
GRANT ALL PRIVILEGES ON keystone.* TO