Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494144 - sys-auth/keystone-2013.2.r2 - token-get fails
Summary: sys-auth/keystone-2013.2.r2 - token-get fails
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo OpenStack team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2013-12-13 13:18 UTC by Davide Rebeccani
Modified: 2013-12-13 17:32 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
keystone-2013.2-r1.ebuild (keystone-2013.2-r1.ebuild,4.40 KB, text/plain)
2013-12-13 13:23 UTC, Davide Rebeccani
Details
keystone init.d file (keystone.initd,1.25 KB, text/plain)
2013-12-13 13:24 UTC, Davide Rebeccani
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Davide Rebeccani 2013-12-13 13:18:55 UTC
After installing sys-auth/keystone-2013.1.2.r2, and correctly configure the keystone service if you issue the command:

# keystone --os-username=admin --os-password=ADMIN_PASS \
  --os-tenant-name=admin --os-auth-url=http://controller:35357/v2.0 token-get

the service will return an HTTP(500) error like this:

ERROR keystone.common.cms [-] Signing error: Unable to load certificate - ensure you've configured PKI with 'keystone-manage pki_setup'

Reproducible: Always

Steps to Reproduce:
1.emerge =sys-auth/keystone-2013.1.2.r2
2.export OS_SERVICE_TOKEN=ADMIN_PASS && export OS_SERVICE_ENDPOINT=http://controller:35357/v2.0
3.keystone --os-username=admin --os-password=ADMIN_PASS --os-auth-url=http://controller:35357/v2.0 token-get
Actual Results:  
HTTP(500) error

Expected Results:  
The keystone service release the auth token

In openstack-havana keystone token driver is set to PKI, so the build should tell the user to configure openssl and keystone PKI.
Comment 1 Davide Rebeccani 2013-12-13 13:23:01 UTC
Created attachment 365220 [details]
keystone-2013.2-r1.ebuild

Corrected build file with:

1. Creation of keystone user and group to run the daemon under
2. Added pkg_postinst() information about how to configure keystone PKI
3. Added pkg_config() to configure PKI as reported in pkg_postinst()
Comment 2 Davide Rebeccani 2013-12-13 13:24:07 UTC
Created attachment 365222 [details]
keystone init.d file

Fixed keystone init.d file to run the keystone daemon under the keystone user.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2013-12-13 14:29:51 UTC
Comment on attachment 365220 [details]
keystone-2013.2-r1.ebuild

--- keystone-2013.2-r1.ebuild   2013-11-28 18:39:30.380637752 +0100
+++ -   2013-12-13 15:29:34.891724152 +0100
@@ -79,6 +79,11 @@
        "${FILESDIR}/2013.2-CVE-2013-4477.patch"
 )
 
+pkg_setup() {
+       enewgroup keystone
+       enewuser keystone -1 -1 /var/lib/keystone keystone
+}
+
 python_prepare_all() {
        mkdir ${PN}/tests/tmp || die
        cp etc/keystone-paste.ini ${PN}/tests/tmp/ || die
@@ -103,4 +108,26 @@
        doins etc/keystone.conf.sample etc/logging.conf.sample
        doins etc/default_catalog.templates etc/policy.json
        doins etc/policy.v3cloudsample.json etc/keystone-paste.ini
+
+       fowners keystone:keystone /var/run/keystone /var/log/keystone /etc/keystone
+}
+
+pkg_postinst() {
+       elog "You might want to run:"
+       elog "emerge --config =${CATEGORY}/${PF}"
+       elog "if this is a new install."
+       elog "If you have not already configured your openssl installation"
+       elog "please do it by modifying /etc/ssl/openssl.cnf"
+       elog "BEFORE issuing the configuration command."
+       elog "Otherwise default values will be used."
+}
+
+pkg_config() {
+       if [ ! -d "${ROOT}"/etc/keystone/ssl ] ; then
+               einfo "Press ENTER to configure the keystone PKI, or Control-C to abort now..."
+               read
+               "${ROOT}"/usr/bin/keystone-manage pki_setup --keystone-user keystone --keystone-group keystone
+       else
+               einfo "keystone PKI certificates directory already present, skipping configuration"
+       fi
 }
Comment 4 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-13 16:55:20 UTC
is this for 2013.1 or 2013.2? looks like you have both mentioned in the comments.
Comment 5 Davide Rebeccani 2013-12-13 16:58:00 UTC
Sorry for the typo. I was meaning sys-auth/keystone-2013.2-r1 :-)
Comment 6 Matthew Thode ( prometheanfire ) archtester Gentoo Infrastructure gentoo-dev Security 2013-12-13 17:32:06 UTC
fixed in 2013.2-r2 and 2013.2.9999

thanks for all the work :D