From 5fad2f75b6eb3614e908753b07dda48d94bf7ccf Mon Sep 17 00:00:00 2001 From: Mihai Prica Date: Tue, 16 Jul 2013 17:37:31 +0300 Subject: python-keystone: 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 --- .../recipes-devtools/python/python-keystone/keystone.conf | 5 ++--- meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb | 6 ++++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'meta-openstack/recipes-devtools/python') diff --git a/meta-openstack/recipes-devtools/python/python-keystone/keystone.conf b/meta-openstack/recipes-devtools/python/python-keystone/keystone.conf index b21aa81..954db2e 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone/keystone.conf +++ b/meta-openstack/recipes-devtools/python/python-keystone/keystone.conf @@ -1,6 +1,6 @@ [DEFAULT] # A "shared secret" between keystone and other openstack services -admin_token=password +admin_token=%SERVICE_TOKEN% # The IP address of the network interface to listen on # bind_host = 0.0.0.0 @@ -75,8 +75,7 @@ admin_token=password [sql] # The SQLAlchemy connection string used to connect to the database -# connection = sqlite:////etc/keystone/keystone.db -connection = postgresql://admin:admin@localhost/keystone +connection = postgresql://%DB_USER%:%DB_PASSWORD%@localhost/keystone # the timeout before idle sql connections are reaped # idle_timeout = 200 diff --git a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb index d6ad46d..cad802a 100644 --- a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb +++ b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb @@ -29,7 +29,9 @@ do_install_append() { install -d ${KEYSTONE_CONF_DIR} - sed -e "s:^admin_token=.*:admin_token=${SERVICE_TOKEN}:g" -i ${WORKDIR}/keystone.conf + sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${WORKDIR}/keystone.conf + sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/keystone.conf + sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/keystone.conf install -m 600 ${WORKDIR}/keystone.conf ${KEYSTONE_CONF_DIR}/ install -m 600 ${WORKDIR}/identity.sh ${KEYSTONE_CONF_DIR}/ @@ -57,7 +59,7 @@ pkg_postinst_${SRCNAME} () { 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 keystone -- cgit v1.2.3-54-g00ecf