Rien de sorcier ici, juste un pense bete

Changer le suffix de base de notre annuaire

suffix.ldif :

dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcSuffix
olcSuffix: dc=pepiniere,dc=fr
 ldapmodify -Y EXTERNAL -H ldapi:/// -f suffix.ldif  %%%

Changer le rootDN et son mot de passe

rootdn.ldif :

dn: olcDatabase={1}mdb,cn=config
changetype: modify
replace: olcRootDN
olcRootDN: cn=admin,dc=pepiniere,dc=fr
-
replace: olcRootPW
olcRootPW: foobar123
dapmodify -Y EXTERNAL -H ldapi:/// -f rootdn.ldif

Nous avons maintenant notre suffixe fonctionel !

Ensuite nous allons initialiser nos blocs users et groups ave le ldif suivant :

# Subtree for Users
dn:                       ou=Users,dc=newdomain,dc=tld
ou:                       Users
description:           Parent Ldap Users
objectClass:           organizationalUnit
objectClass:           top
structuralObjectClass: organizationalUnit
# Subtree for Groups
dn:                    ou=Groups,dc=newdomain,dc=tld
ou:                    Groups
description:           Parent LDAP Groups
objectClass:           organizationalUnit
objectClass:           top
structuralObjectClass: organizationalUnit

Pensez à verifier les ownership, puis relancez slapd :

chown openldap.openldap /var/lib/ldap/*
service slapd start

Slapcat et ldapsearch montrent que notre arbre est bien installé !

Voila :)