From 9d06f8b343a0db944d34991af071b29028af1028 Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Tue, 16 Jul 2013 17:37:45 +0300 Subject: python-nova: Configure postgresql credentials The user and password for postgresql are defined in the identity class and are loaded by the recipes from this class. Signed-off-by: Mihai Prica --- meta-openstack/recipes-devtools/python/python-nova/nova.conf | 2 +- meta-openstack/recipes-devtools/python/python-nova_2013.1.bb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'meta-openstack/recipes-devtools/python') diff --git a/meta-openstack/recipes-devtools/python/python-nova/nova.conf b/meta-openstack/recipes-devtools/python/python-nova/nova.conf index e33c172..3c90674 100644 --- a/meta-openstack/recipes-devtools/python/python-nova/nova.conf +++ b/meta-openstack/recipes-devtools/python/python-nova/nova.conf @@ -34,7 +34,7 @@ force_dhcp_release=False dhcpbridge=/usr/bin/nova-dhcpbridge #Database configuration -sql_connection = postgresql://admin:admin@localhost/nova +sql_connection = postgresql://%DB_USER%:%DB_PASSWORD%@localhost/nova #RabbitMQ configuration rpc_backend = nova.rpc.impl_kombu diff --git a/meta-openstack/recipes-devtools/python/python-nova_2013.1.bb b/meta-openstack/recipes-devtools/python/python-nova_2013.1.bb index 5a3750a..aeeacbc 100644 --- a/meta-openstack/recipes-devtools/python/python-nova_2013.1.bb +++ b/meta-openstack/recipes-devtools/python/python-nova_2013.1.bb @@ -54,6 +54,9 @@ do_install_append() { sed -e "s:%SERVICE_PASSWORD%:${SERVICE_PASSWORD}:g" \ -i ${WORKDIR}/api-paste.ini + sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/nova.conf + sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/nova.conf + #Copy the configuration file install -m 664 ${WORKDIR}/nova.conf ${NOVA_CONF_DIR}/nova.conf install -m 664 ${WORKDIR}/api-paste.ini ${NOVA_CONF_DIR} @@ -85,7 +88,7 @@ pkg_postinst_${SRCNAME}-controller () { sudo -u postgres initdb -D /etc/postgresql/ /etc/init.d/postgresql start sleep 0.2 - sudo -u postgres psql -c "CREATE ROLE admin WITH SUPERUSER LOGIN PASSWORD 'admin'" + sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" fi sudo -u postgres createdb nova -- cgit v1.2.3-54-g00ecf