summaryrefslogtreecommitdiffstats
path: root/meta-openstack/recipes-support/openldap/openldap_2.4.39.bbappend
diff options
context:
space:
mode:
authorAmy Fong <amy.fong@windriver.com>2014-07-22 10:07:48 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2014-07-30 00:50:20 -0400
commit010135a5b132197a784d3f337748433278f1fad8 (patch)
treed858faa9a437fa9ad7ab305d95ce371bb963ffc5 /meta-openstack/recipes-support/openldap/openldap_2.4.39.bbappend
parentf367c5dc967789030d778e81bd4c0340302fd50e (diff)
downloadmeta-cloud-services-010135a5b132197a784d3f337748433278f1fad8.tar.gz
keystone: openldap packaging
Add openstack specific parts of openldap. openldap's init script initializes the data with the basic tree structures needed for keystone - the Group, User and Role tree. Additionally, we add two variables which can be set in local.conf, LDAP_DN - default DN for ldap default: "dc=my-domain,dc=com" LDAP_DATADIR - default directory for ldap's data directory default: "/etc/openldap-data/" Signed-off-by: Amy Fong <amy.fong@windriver.com>
Diffstat (limited to 'meta-openstack/recipes-support/openldap/openldap_2.4.39.bbappend')
-rw-r--r--meta-openstack/recipes-support/openldap/openldap_2.4.39.bbappend67
1 files changed, 67 insertions, 0 deletions
diff --git a/meta-openstack/recipes-support/openldap/openldap_2.4.39.bbappend b/meta-openstack/recipes-support/openldap/openldap_2.4.39.bbappend
new file mode 100644
index 0000000..d8166ce
--- /dev/null
+++ b/meta-openstack/recipes-support/openldap/openldap_2.4.39.bbappend
@@ -0,0 +1,67 @@
1PRINC = "2"
2
3DEPEND_${PN} += "cyrus-sasl"
4RDEPEND_${PN} += "libsasl2-modules"
5
6FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
7SRC_URI += "file://initscript"
8SRC_URI += "file://ops-base.ldif"
9
10LDAP_DN ?= "dc=my-domain,dc=com"
11LDAP_DATADIR ?= "/etc/openldap-data/"
12
13do_install_append() {
14 install -D -m 0755 ${WORKDIR}/initscript ${D}${sysconfdir}/init.d/openldap
15 sed -i -e 's/%DEFAULT_DN%/${LDAP_DN}/g' ${D}${sysconfdir}/init.d/openldap
16 sed -i -e 's#%LDAP_DATADIR%#${LDAP_DATADIR}#g' ${D}${sysconfdir}/init.d/openldap
17
18 # This is duplicated in /etc/openldap and is for slapd
19 rm -f ${D}${localstatedir}/openldap-data/DB_CONFIG.example
20 rmdir "${D}${localstatedir}/run"
21 rmdir --ignore-fail-on-non-empty "${D}${localstatedir}"
22
23 # remove symlinks for backends, recreating in postinstall
24 rm ${D}/${libexecdir}/openldap/*.so
25
26 sed -i -e '/^include\s*/a \
27include /etc/openldap/schema/cosine.schema \
28include /etc/openldap/schema/nis.schema \
29include /etc/openldap/schema/inetorgperson.schema \
30include /etc/openldap/schema/misc.schema' \
31 ${D}/etc/openldap/slapd.conf
32
33 sed -i -e '/^# Load dynamic backend modules:/a \
34modulepath /usr/libexec/openldap \
35moduleload back_bdb.la' \
36 ${D}/etc/openldap/slapd.conf
37
38 sed -i -e 's#^pidfile\s*.*$#pidfile ${LDAP_DATADIR}/slapd.pid#' ${D}/etc/openldap/slapd.conf
39 sed -i -e 's#^argsfile\s*.*$#argsfile ${LDAP_DATADIR}/slapd.args#' ${D}/etc/openldap/slapd.conf
40 sed -i -e 's#^directory\s*.*$#directory ${LDAP_DATADIR}/#' ${D}/etc/openldap/slapd.conf
41
42 sed -i -e 's/dc=my-domain,dc=com/${LDAP_DN}/g' ${D}/etc/openldap/slapd.conf
43
44 # modify access perms for ldap/authentication
45 sed -i -e '$a\
46\
47access to attrs=userPassword \
48 by self write \
49 by anonymous auth \
50 by * none \
51\
52access to * \
53 by self write \
54 by * read' \
55 ${D}/etc/openldap/slapd.conf
56
57 install -D -m 0644 ${WORKDIR}/ops-base.ldif ${D}/etc/openldap/ops-base.ldif
58 sed -i -e 's/dc=my-domain,dc=com/${LDAP_DN}/g' ${D}/etc/openldap/ops-base.ldif
59
60 mkdir ${D}/${LDAP_DATADIR}
61}
62
63inherit update-rc.d
64
65INITSCRIPT_NAME = "openldap"
66INITSCRIPT_PARAMS = "defaults"
67