This is an old revision of the document!
installation dans /usr/local/openldap
[root@ldapex ~]# cd /usr/local/openldap/etc/openldap/
utilisation d'un script maison pour reconstruction de la config OLC (slpad.d) depuis un fichier de configuration traditionnel slapd.conf, avec arborescence de type ltb-project (/usr/local/openldap)
[root@ldapex openldap]# cat olcgene.sh systemctl stop slapd cd /usr/local/openldap/etc/openldap/slapd.d rm -rf * cd .. /usr/local/openldap/sbin/slaptest -f /usr/local/openldap/etc/openldap/slapd.conf -F /usr/local/openldap/etc/openldap/slapd.d chown -R ldap:ldap /usr/local/openldap/etc/openldap/slapd.d chown -R ldap:ldap /usr/local/openldap/var/openldap-data systemctl start slapd
éléments ajoutés pour une configuration incluant plusieurs schema (supann, eduperson etc …)
include /usr/local/openldap/etc/openldap/schema/supann-2019-02-05.schema include /usr/local/openldap/etc/openldap/schema/eduperson-200412.schema
#JP TLS TLSCACertificateFile /etc/pki/tls/certs/chain-dc-TR1-CA2-star-imt.pem TLSCertificateFile /etc/pki/tls/certs/star_imteu.pem TLSCertificateKeyFile /etc/pki/tls/private/star_imteunp.key
loglevel pour faire apparaitre syncrepl (16384) et les operations (256) , somme = 16640:
loglevel 16640 threads 8 defaultsearchbase dc=int,dc=fr
#JP https://services.renater.fr/documentation/supann/supann2018/recommandations2018/modele/options AttributeOptions x-
Enfin, la dafinition de notre database pour la racinede l'arbre ldap a servir, ici dc=int,dc=fr
database mdb maxsize 1073741824 suffix "dc=int,dc=fr" rootdn "cn=admin,dc=int,dc=fr" # rootpw secret rootpw {SSHA}lAENVGROSECRETZAETBNHY8.z/ directory /usr/local/openldap/var/openldap-data index objectClass,entryUUID eq index uid,cn,sn,mail eq,pres,sub #JP acl include depuis un fichier a part pour meilleur lecture, cf plus bas include /usr/local/openldap/etc/openldap/slapd.acl.conf # JP syncrepl , idem include depuis un fichier a part pour meilleur lecture, cf plus bas include /usr/local/openldap/etc/openldap/slapd.sync.conf
sur ce replica partiel (pages blanches) , ACL assez simples
[root@ldapex openldap]# cat slapd.acl.conf # attribut userpassword, utile ici uniquement pour le compte DSA cn=rep access to attrs=userPassword by self auth by anonymous auth by dn="cn=rep,ou=dsa,dc=int,dc=fr" read by * none #Voir le root DSE + base DN , cf http://www.openldap.org/lists/openldap-technical/201203/msg00132.html access to dn.subtree="dc=int,dc=fr" attrs=entry,contextCSN,objectclass,mail,title,sn,cn,givenName,uid,telephoneNumber,ou,departmentNumber,employeeType,businessCategory by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage by users read by anonymous none by * none access to * by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" manage by self read by dn="cn=rep,ou=dsa,dc=int,dc=fr" read by * none
Script qui permet de recontruire complement le replica partiel , avec injection de l'arborescence de base (dc=int,dc=fr et le compte de requttage dans ou=dsa) puis relance avec syncrepl pour recuperer toutes les entrée ou=people depuis le master .
[root@ldapex openldap]# cat disiRebuildAllRep.sh #stop slapd service systemctl stop slapd #delete all databases rm -f /usr/local/openldap/var/openldap-data/*.mdb #delete all OLC config cd /usr/local/openldap/etc/openldap/slapd.d rm -rf * cd .. #rebuild slpad.d OLC config from slapd-nosync.conf (copy of slapd.conf but without syncrep config) #because of updateref incompatibility with inital load of local root tree and dsa accounts /usr/local/openldap/sbin/slaptest -f /usr/local/openldap/etc/openldap/slapd-nosync.conf -F /usr/local/openldap/etc/openldap/slapd.d #reset ldap acces to subtree slapd.d chown -R ldap:ldap /usr/local/openldap/etc/openldap/slapd.d #reset ldap acces to subtree databases directory chown -R ldap:ldap /usr/local/openldap/var/openldap-data #restart slapd service systemctl start slapd #insert root tree and local dsa account from ldif with ldapi (local soket connect) /usr/local/openldap/bin/ldapadd -H ldapi://%2Fvar%2Frun%2Fslapd%2Fldapi -Y EXTERNAL -f /root/Ldifs/dc-int-ldapex.ldif -c #pause 1s with sleep 1 sleep 1 #stop slapd service again this time to reload config with syncrepl enabled systemctl stop slapd #delete all OLC config cd /usr/local/openldap/etc/openldap/slapd.d rm -rf * cd .. #rebuild slpad.d OLC config from slapd.conf (containing the syncrepl included) /usr/local/openldap/sbin/slaptest -f /usr/local/openldap/etc/openldap/slapd.conf -F /usr/local/openldap/etc/openldap/slapd.d #reset ldap acces to subtree slapd.d chown -R ldap:ldap /usr/local/openldap/etc/openldap/slapd.d #reset ldap acces to subtree databases directory chown -R ldap:ldap /usr/local/openldap/var/openldap-data #restart slapd service systemctl start slapd