From 23921d0cbd5b729f056b600e39c0ad8883b010d7 Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Tue, 16 Jul 2013 17:07:03 +0300 Subject: postgresql: Made the postgresql credentials configurable 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/classes/identity.bbclass | 2 ++ meta-openstack/recipes-support/postgresql/postgresql_8.4.7.bbappend | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/meta-openstack/classes/identity.bbclass b/meta-openstack/classes/identity.bbclass index 07c8efc..b86eb76 100644 --- a/meta-openstack/classes/identity.bbclass +++ b/meta-openstack/classes/identity.bbclass @@ -1,3 +1,5 @@ SERVICE_TOKEN = "password" SERVICE_PASSWORD = "password" SERVICE_TENANT_NAME = "service" +DB_USER = "admin" +DB_PASSWORD = "admin" diff --git a/meta-openstack/recipes-support/postgresql/postgresql_8.4.7.bbappend b/meta-openstack/recipes-support/postgresql/postgresql_8.4.7.bbappend index a2390e4..98e7207 100644 --- a/meta-openstack/recipes-support/postgresql/postgresql_8.4.7.bbappend +++ b/meta-openstack/recipes-support/postgresql/postgresql_8.4.7.bbappend @@ -3,7 +3,7 @@ PRINC := "${@int(PRINC) + 1}" SRC_URI += "file://postgresql" -inherit useradd update-rc.d +inherit useradd update-rc.d identity do_install_append() { install -d ${D}${sysconfdir}/${PN} @@ -25,7 +25,7 @@ pkg_postinst_${PN} () { sudo -u postgres initdb -D /etc/${PN}/ /etc/init.d/postgresql start - 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}'" ln -s /usr/share/zoneinfo /usr/share/postgresql/timezone } -- cgit v1.2.3-54-g00ecf