training-guides/labs/scripts/setup_keystonedb.sh
Roger Luethi 49541b99cb Adjust permissions
This changeset
- removes executable bits from README.md
- adds executable bits to shell scripts

These changes are largely symbolic, except for osbash.sh which users are
expected to run without having to change permissions or passing it as an
argument to bash.

Partial-Bug: 1312764
Implements: blueprint openstack-training-labs
Change-Id: I91cce85862171a360c31e1e7628a708dfefd70f1
2014-06-18 13:26:10 +02:00

30 lines
716 B
Bash
Executable File

#!/usr/bin/env bash
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
source "$TOP_DIR/config/paths"
source "$CONFIG_DIR/credentials"
source "$LIB_DIR/functions.guest"
exec_logfile
indicate_current_auto
#-------------------------------------------------------------------------------
# Create database Keystone, Glance, Quantum, Nova, and Cinder
function mysql_exe {
local CMD="$1"
echo mysql -u "root" -p"$DATABASE_PASSWORD" -e "$CMD"
}
function setup_database {
local DB=$1
mysql_exe "CREATE DATABASE $DB"
mysql_exe "GRANT ALL ON ${DB}.* TO '${DB}User'@'%' IDENTIFIED BY '${DB}Pass';"
}
setup_database keystone
setup_database glance
setup_database neutron
setup_database nova
setup_database cinder