2 mysql -uroot -Dmysql <<EOF
3 drop database if exists keystone;
4 drop database if exists glance;
5 drop database if exists neutron;
6 drop database if exists nova;
7 drop database if exists cinder;
9 CREATE DATABASE keystone;
10 {% for host in ['%', 'localhost', inventory_hostname] %}
11 GRANT ALL ON keystone.* TO 'keystone'@'{{ host }}' IDENTIFIED BY '{{ KEYSTONE_DBPASS }}';
14 CREATE DATABASE glance;
15 {% for host in ['%', 'localhost', inventory_hostname] %}
16 GRANT ALL ON glance.* TO 'glance'@'{{ host }}' IDENTIFIED BY '{{ GLANCE_DBPASS }}';
19 CREATE DATABASE neutron;
20 {% for host in ['%', 'localhost', inventory_hostname] %}
21 GRANT ALL ON neutron.* TO 'neutron'@'{{ host }}' IDENTIFIED BY '{{ NEUTRON_DBPASS }}';
25 {% for host in ['%', 'localhost', inventory_hostname] %}
26 GRANT ALL ON nova.* TO 'nova'@'{{ host }}' IDENTIFIED BY '{{ NOVA_DBPASS }}';
29 CREATE DATABASE cinder;
30 {% for host in ['%', 'localhost', inventory_hostname] %}
31 GRANT ALL ON cinder.* TO 'cinder'@'{{ host }}' IDENTIFIED BY '{{ CINDER_DBPASS }}';
34 {% if WSREP_SST_USER is defined %}
35 {% for host in ['%', 'localhost', inventory_hostname] %}
36 GRANT ALL ON *.* TO '{{ WSREP_SST_USER }}'@'{{ host }}' IDENTIFIED BY '{{ WSREP_SST_PASS }}';