summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python
diff options
context:
space:
mode:
authorMihai Prica <prica.mihai@gmail.com>2013-07-16 17:37:31 +0300
committerBruce Ashfield <bruce.ashfield@windriver.com>2013-08-28 18:41:58 -0400
commit5fad2f75b6eb3614e908753b07dda48d94bf7ccf (patch)
treed238961914ca3a377ffa9308961c918cc839d1b4 /meta-openstack/recipes-devtools/python
parentb7513ae56a129f223c1db088722e87a56500c95e (diff)
downloadmeta-cloud-services-5fad2f75b6eb3614e908753b07dda48d94bf7ccf.tar.gz
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 <prica.mihai@gmail.com>
Diffstat (limited to 'meta-openstack/recipes-devtools/python')
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone/keystone.conf5
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone_2013.1.bb6
2 files changed, 6 insertions, 5 deletions
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 @@
1[DEFAULT] 1[DEFAULT]
2# A "shared secret" between keystone and other openstack services 2# A "shared secret" between keystone and other openstack services
3admin_token=password 3admin_token=%SERVICE_TOKEN%
4 4
5# The IP address of the network interface to listen on 5# The IP address of the network interface to listen on
6# bind_host = 0.0.0.0 6# bind_host = 0.0.0.0
@@ -75,8 +75,7 @@ admin_token=password
75 75
76[sql] 76[sql]
77# The SQLAlchemy connection string used to connect to the database 77# The SQLAlchemy connection string used to connect to the database
78# connection = sqlite:////etc/keystone/keystone.db 78connection = postgresql://%DB_USER%:%DB_PASSWORD%@localhost/keystone
79connection = postgresql://admin:admin@localhost/keystone
80 79
81# the timeout before idle sql connections are reaped 80# the timeout before idle sql connections are reaped
82# idle_timeout = 200 81# 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() {
29 29
30 install -d ${KEYSTONE_CONF_DIR} 30 install -d ${KEYSTONE_CONF_DIR}
31 31
32 sed -e "s:^admin_token=.*:admin_token=${SERVICE_TOKEN}:g" -i ${WORKDIR}/keystone.conf 32 sed -e "s:%SERVICE_TOKEN%:${SERVICE_TOKEN}:g" -i ${WORKDIR}/keystone.conf
33 sed -e "s:%DB_USER%:${DB_USER}:g" -i ${WORKDIR}/keystone.conf
34 sed -e "s:%DB_PASSWORD%:${DB_PASSWORD}:g" -i ${WORKDIR}/keystone.conf
33 35
34 install -m 600 ${WORKDIR}/keystone.conf ${KEYSTONE_CONF_DIR}/ 36 install -m 600 ${WORKDIR}/keystone.conf ${KEYSTONE_CONF_DIR}/
35 install -m 600 ${WORKDIR}/identity.sh ${KEYSTONE_CONF_DIR}/ 37 install -m 600 ${WORKDIR}/identity.sh ${KEYSTONE_CONF_DIR}/
@@ -57,7 +59,7 @@ pkg_postinst_${SRCNAME} () {
57 sudo -u postgres initdb -D /etc/postgresql/ 59 sudo -u postgres initdb -D /etc/postgresql/
58 /etc/init.d/postgresql start 60 /etc/init.d/postgresql start
59 sleep 0.2 61 sleep 0.2
60 sudo -u postgres psql -c "CREATE ROLE admin WITH SUPERUSER LOGIN PASSWORD 'admin'" 62 sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'"
61 fi 63 fi
62 64
63 sudo -u postgres createdb keystone 65 sudo -u postgres createdb keystone