Create LDAP indeces on installation for fields the web GUI searches against

This commit is contained in:
Rob Crittenden 2007-10-30 13:41:41 -04:00
parent c116f8d739
commit 3c8cfd94bd
3 changed files with 72 additions and 0 deletions

View File

@ -7,6 +7,7 @@ app_DATA = \
bootstrap-template.ldif \
default-aci.ldif \
kerberos.ldif \
indeces.ldif \
bind.named.conf.template\
bind.zone.db.template \
certmap.conf.template \

View File

@ -0,0 +1,57 @@
dn: cn=krbPrincipalName,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass:top
objectClass:nsIndex
cn:krbPrincipalName
nsSystemIndex:false
nsIndexType:eq
nsIndexType:sub
dn: cn=ou,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass:top
objectClass:nsIndex
cn:ou
nsSystemIndex:false
nsIndexType:eq
nsIndexType:sub
dn: cn=carLicense,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass:top
objectClass:nsIndex
cn:carLicense
nsSystemIndex:false
nsIndexType:eq
nsIndexType:sub
dn: cn=title,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass:top
objectClass:nsIndex
cn:title
nsSystemIndex:false
nsIndexType:eq
nsIndexType:sub
dn: cn=manager,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass:top
objectClass:nsIndex
cn:manager
nsSystemIndex:false
nsIndexType:eq
dn: cn=displayname,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: add
objectClass:top
objectClass:nsIndex
cn:displayname
nsSystemIndex:false
nsIndexType:eq
nsIndexType:sub
dn: cn=uid,cn=index,cn=userRoot,cn=ldbm database,cn=plugins,cn=config
changetype: modify
add: nsIndexType
nsIndexType:sub

View File

@ -81,6 +81,7 @@ class DsInstance:
self.__create_instance()
self.__add_default_schemas()
self.__add_memberof_module()
self.__create_indeces()
self.__enable_ssl()
self.__certmap_conf()
try:
@ -194,6 +195,19 @@ class DsInstance:
print "Failed to add default ds layout", e
logging.debug("Failed to add default ds layout %s" % e)
def __create_indeces(self):
txt = template_file(SHARE_DIR + "indeces.ldif", self.sub_dict)
inf_fd = write_tmp_file(txt)
logging.debug("adding/updating indeces")
args = ["/usr/bin/ldapmodify", "-xv", "-D", "cn=Directory Manager",
"-w", self.dm_password, "-f", inf_fd.name]
try:
run(args)
logging.debug("done adding/updating indeces")
except subprocess.CalledProcessError, e:
print "Failed to add default ds layout", e
logging.debug("Failed to add/update indeces %s" % e)
def __certmap_conf(self):
logging.debug("configuring certmap.conf for ds instance")
dirname = self.config_dirname()