diff --git a/elements/openstack-db/README.md b/elements/openstack-db/README.md new file mode 100644 index 000000000..9f6763f40 --- /dev/null +++ b/elements/openstack-db/README.md @@ -0,0 +1,2 @@ +Installs all openstack sql databases on a single server, +for the purpose of building a bootstrap image. diff --git a/elements/openstack-db/element-deps b/elements/openstack-db/element-deps new file mode 100644 index 000000000..922e0545d --- /dev/null +++ b/elements/openstack-db/element-deps @@ -0,0 +1,2 @@ +os-svc-install +keystone-config diff --git a/elements/openstack-db/first-boot.d/50-openstack-db b/elements/openstack-db/first-boot.d/50-openstack-db new file mode 100755 index 000000000..c8ae46693 --- /dev/null +++ b/elements/openstack-db/first-boot.d/50-openstack-db @@ -0,0 +1,25 @@ +#!/bin/bash +set -eu + +# TODO: make this easily configurable +db_pass=stackdb + +service mysql restart + +create-os-db keystone keystone $db_pass +keystone-manage db_sync + +create-os-db cinder cinder $db_pass +cinder-manage db sync + +create-os-db nova nova $db_pass +nova-manage db sync + +create-os-db nova_bm nova $db_pass +nova-baremetal-manage db sync + +create-os-db glance glance $db_pass +glance-manage db_sync + +create-os-db ovs_quantum quantum $db_pass + diff --git a/elements/openstack-db/install.d/50-openstack-db b/elements/openstack-db/install.d/50-openstack-db new file mode 100755 index 000000000..caba91eb3 --- /dev/null +++ b/elements/openstack-db/install.d/50-openstack-db @@ -0,0 +1,11 @@ +#!/bin/bash +set -eu + +install-packages mysql-server python-mysqldb +sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf + +os-svc-install -u keystone -r https://github.com/openstack/keystone.git +os-svc-install -u cinder -r https://github.com/openstack/cinder.git +os-svc-install -u nova -r https://github.com/openstack/nova.git +os-svc-install -u glance -r https://github.com/openstack/glance.git +os-svc-install -u quantum -r https://github.com/openstack/quantum.git