summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-devtools/python/python-keystone_git.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta-openstack/recipes-devtools/python/python-keystone_git.bb')
-rw-r--r--meta-openstack/recipes-devtools/python/python-keystone_git.bb114
1 files changed, 114 insertions, 0 deletions
diff --git a/meta-openstack/recipes-devtools/python/python-keystone_git.bb b/meta-openstack/recipes-devtools/python/python-keystone_git.bb
new file mode 100644
index 0000000..882848a
--- /dev/null
+++ b/meta-openstack/recipes-devtools/python/python-keystone_git.bb
@@ -0,0 +1,114 @@
1DESCRIPTION = "Authentication service for OpenStack"
2HOMEPAGE = "http://www.openstack.org"
3SECTION = "devel/python"
4LICENSE = "Apache-2.0"
5LIC_FILES_CHKSUM = "file://LICENSE;md5=1dece7821bf3fd70fe1309eaa37d52a2"
6
7PR = "r0"
8SRCNAME = "keystone"
9
10SRC_URI = "git://github.com/openstack/${SRCNAME}.git;branch=stable/havana \
11 file://keystone.conf \
12 file://identity.sh \
13 file://keystone \
14 file://openrc \
15 "
16
17SRCREV="4221b6020e6b0b42325d8904d7b8a22577a6acc0"
18PV="2013.2+git${SRCPV}"
19
20S = "${WORKDIR}/git"
21
22inherit setuptools update-rc.d identity hosts
23
24SERVICE_TOKEN = "password"
25
26do_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 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/keystone.conf
37 sed -e "s:%CONTROLLER_IP%:${CONTROLLER_IP}:g" -i ${WORKDIR}/identity.sh
38
39 install -d ${D}${localstatedir}/log/${SRCNAME}
40
41 install -m 600 ${WORKDIR}/keystone.conf ${KEYSTONE_CONF_DIR}/
42 install -m 600 ${WORKDIR}/identity.sh ${KEYSTONE_CONF_DIR}/
43 install -m 600 ${WORKDIR}/openrc ${KEYSTONE_CONF_DIR}/
44 install -m 600 ${S}/etc/logging.conf.sample ${KEYSTONE_CONF_DIR}/logging.conf
45 install -m 600 ${S}/etc/policy.json ${KEYSTONE_CONF_DIR}/policy.json
46
47 if ${@base_contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
48 install -d ${D}${sysconfdir}/init.d
49 install -m 0755 ${WORKDIR}/keystone ${D}${sysconfdir}/init.d/keystone
50 fi
51}
52
53pkg_postinst_${SRCNAME} () {
54 # python-keystone postinst start
55 if [ "x$D" != "x" ]; then
56 exit 1
57 fi
58
59 # This is to make sure postgres is configured and running
60 if ! pidof postmaster > /dev/null; then
61 /etc/init.d/postgresql-init
62 /etc/init.d/postgresql start
63 sleep 5
64 fi
65
66 sudo -u postgres createdb keystone
67 keystone-manage db_sync
68 keystone-manage pki_setup --keystone-user=root --keystone-group=root
69
70 # Create users, services and endpoints
71 /etc/init.d/keystone start
72 sleep 2
73
74 ADMIN_PASSWORD=${ADMIN_PASSWORD} \
75 SERVICE_PASSWORD=${SERVICE_PASSWORD} \
76 SERVICE_TENANT_NAME=${SERVICE_TENANT_NAME} \
77 bash /etc/keystone/identity.sh
78
79 # end python-keystone postinst
80}
81
82PACKAGES += " ${SRCNAME}"
83
84FILES_${PN} = "${libdir}/*"
85
86FILES_${SRCNAME} = "${bindir}/* \
87 ${sysconfdir}/${SRCNAME}/* \
88 ${sysconfdir}/init.d/* \
89 ${localstatedir}/* \
90 "
91
92RDEPENDS_${PN} += "python-pam \
93 python-webob \
94 python-eventlet \
95 python-greenlet \
96 python-pastedeploy \
97 python-paste \
98 python-routes \
99 python-sqlalchemy \
100 python-sqlalchemy-migrate \
101 python-passlib \
102 python-lxml \
103 python-iso8601 \
104 python-keystoneclient \
105 python-oslo.config \
106 python-dogpile.core \
107 python-dogpile.cache \
108 "
109
110RDEPENDS_${SRCNAME} = "${PN} \
111 postgresql postgresql-client python-psycopg2"
112
113INITSCRIPT_PACKAGES = "${SRCNAME}"
114INITSCRIPT_NAME_${SRCNAME} = "keystone"