diff options
author | Rob Crittenden <rcritten@redhat.com> | 2007-10-30 13:41:41 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2007-10-30 13:41:41 -0400 |
commit | 3c8cfd94bd38ee80d7d1a14deddaa2c88ece8c86 (patch) | |
tree | eca5a6b71e4478ae32ee4528c2ee9ae1a3d9c1cb | |
parent | c116f8d739d72cacb8629edc1df2e34ec6636c50 (diff) | |
download | freeipa-3c8cfd94bd38ee80d7d1a14deddaa2c88ece8c86.tar.gz freeipa-3c8cfd94bd38ee80d7d1a14deddaa2c88ece8c86.tar.xz freeipa-3c8cfd94bd38ee80d7d1a14deddaa2c88ece8c86.zip |
Create LDAP indeces on installation for fields the web GUI searches against
-rw-r--r-- | ipa-server/ipa-install/share/Makefile.am | 1 | ||||
-rw-r--r-- | ipa-server/ipa-install/share/indeces.ldif | 57 | ||||
-rw-r--r-- | ipa-server/ipaserver/dsinstance.py | 14 |
3 files changed, 72 insertions, 0 deletions
diff --git a/ipa-server/ipa-install/share/Makefile.am b/ipa-server/ipa-install/share/Makefile.am index 58198c2f..5a7fda3f 100644 --- a/ipa-server/ipa-install/share/Makefile.am +++ b/ipa-server/ipa-install/share/Makefile.am @@ -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 \ diff --git a/ipa-server/ipa-install/share/indeces.ldif b/ipa-server/ipa-install/share/indeces.ldif new file mode 100644 index 00000000..11dc3c0e --- /dev/null +++ b/ipa-server/ipa-install/share/indeces.ldif @@ -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 diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index a3bc3a44..5ef4a402 100644 --- a/ipa-server/ipaserver/dsinstance.py +++ b/ipa-server/ipaserver/dsinstance.py @@ -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: @@ -193,6 +194,19 @@ class DsInstance: except subprocess.CalledProcessError, e: 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") |