diff options
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb')
| -rw-r--r-- | meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb new file mode 100644 index 0000000..14bfc47 --- /dev/null +++ b/meta-openstack/recipes-devtools/python/python-keystone_2013.1.3.bb | |||
| @@ -0,0 +1,103 @@ | |||
| 1 | DESCRIPTION = "Authentication service for OpenStack" | ||
| 2 | HOMEPAGE = "http://www.openstack.org" | ||
| 3 | SECTION = "devel/python" | ||
| 4 | LICENSE = "Apache-2.0" | ||
| 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2" | ||
| 6 | |||
| 7 | PR = "r0" | ||
| 8 | SRCNAME = "keystone" | ||
| 9 | |||
| 10 | SRC_URI = "https://launchpad.net/keystone/grizzly/${PV}/+download/${SRCNAME}-${PV}.tar.gz \ | ||
| 11 | file://keystone.conf \ | ||
| 12 | file://identity.sh \ | ||
| 13 | file://keystone \ | ||
| 14 | file://openrc \ | ||
| 15 | " | ||
| 16 | |||
| 17 | SRC_URI[md5sum] = "49bfcd088426960ef787d040ea8426af" | ||
| 18 | SRC_URI[sha256sum] = "e097170ebb1cf22de50f2d5ab2216a5116ffe0934720dbad8b02d61c370b8261" | ||
| 19 | |||
| 20 | S = "${WORKDIR}/${SRCNAME}-${PV}" | ||
| 21 | |||
| 22 | inherit setuptools update-rc.d identity | ||
| 23 | |||
| 24 | SERVICE_TOKEN = "password" | ||
| 25 | |||
| 26 | do_install_append() { | ||
| 27 | |||
| 28 | KEYSTONE_CONF_DIR=${D}${sysconfdir}/keystone | ||
| 29 | |||
| 30 | install -d ${KEYSTONE_CONF_DIR} | ||
| 31 | |||
| 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 | ||
| 35 | |||
| 36 | install -m 600 ${WORKDIR}/keystone.conf ${KEYSTONE_CONF_DIR}/ | ||
| 37 | install -m 600 ${WORKDIR}/identity.sh ${KEYSTONE_CONF_DIR}/ | ||
| 38 | install -m 600 ${WORKDIR}/openrc ${KEYSTONE_CONF_DIR}/ | ||
| 39 | install -m 600 ${S}/etc/logging.conf.sample ${KEYSTONE_CONF_DIR}/logging.conf | ||
| 40 | install -m 600 ${S}/etc/policy.json ${KEYSTONE_CONF_DIR}/policy.json | ||
| 41 | |||
| 42 | if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then | ||
| 43 | install -d ${D}${sysconfdir}/init.d | ||
| 44 | install -m 0755 ${WORKDIR}/keystone ${D}${sysconfdir}/init.d/keystone | ||
| 45 | fi | ||
| 46 | } | ||
| 47 | |||
| 48 | pkg_postinst_${SRCNAME} () { | ||
| 49 | |||
| 50 | if [ "x$D" != "x" ]; then | ||
| 51 | exit 1 | ||
| 52 | fi | ||
| 53 | |||
| 54 | # This is to make sure postgres is configured and running | ||
| 55 | if ! pidof postmaster > /dev/null; then | ||
| 56 | sudo -u postgres initdb -D /etc/postgresql/ | ||
| 57 | /etc/init.d/postgresql start | ||
| 58 | sleep 0.2 | ||
| 59 | sudo -u postgres psql -c "CREATE ROLE ${DB_USER} WITH SUPERUSER LOGIN PASSWORD '${DB_PASSWORD}'" | ||
| 60 | fi | ||
| 61 | |||
| 62 | sudo -u postgres createdb keystone | ||
| 63 | keystone-manage db_sync | ||
| 64 | keystone-manage pki_setup | ||
| 65 | |||
| 66 | #Create users, services and endpoints | ||
| 67 | /etc/init.d/keystone start | ||
| 68 | sleep 0.25 | ||
| 69 | ADMIN_PASSWORD=${ADMIN_PASSWORD} \ | ||
| 70 | SERVICE_PASSWORD=${SERVICE_PASSWORD} \ | ||
| 71 | SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME} \ | ||
| 72 | bash /etc/keystone/identity.sh | ||
| 73 | } | ||
| 74 | |||
| 75 | PACKAGES += " ${SRCNAME}" | ||
| 76 | |||
| 77 | FILES_${PN} = "${libdir}/*" | ||
| 78 | |||
| 79 | FILES_${SRCNAME} = "${bindir}/* \ | ||
| 80 | ${sysconfdir}/${SRCNAME}/* \ | ||
| 81 | ${sysconfdir}/init.d/* " | ||
| 82 | |||
| 83 | RDEPENDS_${PN} += "python-pam \ | ||
| 84 | python-webob \ | ||
| 85 | python-eventlet \ | ||
| 86 | python-greenlet \ | ||
| 87 | python-pastedeploy \ | ||
| 88 | python-paste \ | ||
| 89 | python-routes \ | ||
| 90 | python-sqlalchemy \ | ||
| 91 | python-sqlalchemy-migrate \ | ||
| 92 | python-passlib \ | ||
| 93 | python-lxml \ | ||
| 94 | python-iso8601 \ | ||
| 95 | python-keystoneclient \ | ||
| 96 | python-oslo.config \ | ||
| 97 | " | ||
| 98 | |||
| 99 | RDEPENDS_${SRCNAME} = "${PN} \ | ||
| 100 | postgresql postgresql-client python-psycopg2" | ||
| 101 | |||
| 102 | INITSCRIPT_PACKAGES = "${SRCNAME}" | ||
| 103 | INITSCRIPT_NAME_${SRCNAME} = "keystone" | ||
