osixia / docker-openldap

OpenLDAP container image 🐳🌴
MIT License
4.02k stars 973 forks source link

How to enable/load existing schemas from /etc/ldap? #273

Open TonyApuzzo opened 5 years ago

TonyApuzzo commented 5 years ago

I'm moving an OpenLDAP scripted install from a VM to Docker and am trying to use this image. I confess to be quite ignorant of OpenLDAP but am trying to learn.

I have a pre-existing Ansible installation that does:

ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/cosine.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/nis.ldif
ldapadd -Y EXTERNAL -H ldapi:/// -f /etc/ldap/schema/inetorgperson.ldif

I haven't been able to figure out how to initialize these without manually copying the entire contents of /etc/ldap/schemas out of the image and then supplying them as bootstrap entries -- but this seems to be an ugly hack and it causes me to have to manually update the external store in the future if the schemas are updated.

I've seen some alternative Docker images that read from "SCHEMAS" environment variable to load the schemas from /etc/ldap but it doesn't seem like this image can do that. Ultimately I'm headed to using the helm chart anyway so sticking with this image seems preferrable.

What am I missing?

I apologize for asking questions here if this is the wrong place, is there a better forum for newbie questions?

rvalle commented 5 years ago

@TonyApuzzo did you find a way to load schemas?

TonyApuzzo commented 5 years ago

Nope, I ended up sticking with the VM + Packer approach since I didn't have time to learn the 'right' way to do it with Helm. Will revisit again in the future.