Moved database initialization to its own script
This commit is contained in:
parent
2401fb2135
commit
cdfa53ec37
6
roles/mariadb/scripts/initialize_db.sh
Normal file
6
roles/mariadb/scripts/initialize_db.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
mysql -uroot -pgeheim --host 127.0.0.1 << EOF
|
||||||
|
CREATE DATABASE IF NOT EXISTS KEYSTONE;
|
||||||
|
GRANT ALL PRIVILEGES ON KEYSTONE.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
|
||||||
|
GRANT ALL PRIVILEGES ON KEYSTONE.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';
|
||||||
|
EOF
|
@ -14,8 +14,5 @@
|
|||||||
systemd:
|
systemd:
|
||||||
name: mysql.service
|
name: mysql.service
|
||||||
state: started
|
state: started
|
||||||
- name: create keystone db and credentials.
|
- name: Initialize db
|
||||||
command: echo "create database if not exists keystone; \n
|
script: scripts/initialize_db.sh
|
||||||
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone'; \n
|
|
||||||
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone'" \
|
|
||||||
| mysql -uroot -pgeheim --host 127.0.0.1
|
|
||||||
|
Loading…
Reference in New Issue
Block a user