Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support OpenLDAP 2.4 configuration. #57

Open
jof opened this issue May 4, 2015 · 5 comments
Open

Support OpenLDAP 2.4 configuration. #57

jof opened this issue May 4, 2015 · 5 comments
Labels
Feature Request Enhancement to existing functionality or new functionality

Comments

@jof
Copy link

jof commented May 4, 2015

It seems that all the necessary steps are being taken on debian platforms to setup OpenLDAP to have an ocl-style config directory in /etc/ldap/slapd.d: https://github.com/opscode-cookbooks/openldap/blob/master/recipes/server.rb#L84

However, the defaults file for the init script isn't setup to point there.

Fix this template to actually do the right thing.

@jof jof changed the title Setup OpenLDAP 2.4 to actually use ocl config directory. Support OpenLDAP 2.4 configuration. May 8, 2015
@jof
Copy link
Author

jof commented May 8, 2015

OpenLDAP significantly changes how configuration of an OpenLDAP server is handled.
More detail here: http://www.openldap.org/doc/admin24/slapdconf2.html

The short version is that the slapd.conf configuration file is being deprecated, and instead, all the configuration for slapd will come from an LDIF-backed LDAP database (LDAP configuring an LDAP server.... how meta).
With this new scheme, the running configuration of the database may be changed on the fly. Changes will be saved to the LDIF back (/etc/ldap/slapd.d, for example), but not reflected in the slapd.conf file.

This is a problem with the current state of the openldap::master recipe, because as the online configuration changes over time, if any change is made to slapd.conf, it will attempt to "convert" the config into /etc/ldap/slapd.d, but merging in the changes, potentially leading to an un-restart'able database.

I propose we make a few changes:

  • Add some attributes to branch the configuration behavior depending on the package version.
  • If greater than 2.4:
    -- Update the init script defaults options to use slapd.d (as this issue started to do)
    -- Either:
    --- Explicitly not support online configuration changes to cn=config in conjunction with this cookbook. Switch execute[slapd-config-convert] to also empty out the destination directory before converting.
    --- Include a chef_gem like net-ldap and start applying attributes to the running system by using LDAP directly.

Personally, given the level of effort, I would probably select the option of explicitly not supporting online configuration changes.
However, in the long run, this will be the OpenLDAP default and we will have to integrate a chef-level LDAP client to configure the server at some point.

@tas50
Copy link
Contributor

tas50 commented Sep 1, 2015

I'd like to tackle this as part of the rewrite of this cookbook. My first goal is to remove all the client auth setup from the cookbook since that doesn't really have anything to do with openldap other than the LDAP part. After that's complete I'm going to investigate writing LWRPs to handle more robust server installs.

@cheeseplus
Copy link

This one has been open for a while but I'll give an update on the state of things and what we can do from here.

Background: I managed one of the largest OpenLDAP clusters in higher education and personally did the conversion from 2.3 -> 2.4 so strong opinions abound.

  • The tacit support in the cookbook cor cn=config up until 3.0.0 was fundamentally broken as the init scripts still pointed at the slapd.conf

We've removed that entirely since it never really worked and has significant issues regarding future runs. We've been on OpenLDAP 2.4 for 7 years, both administrators and distros still use slapd.conf because it's fundamentally easier to deal with in an automated fashion. We've explicitly stopped supporting slapd.d/cn=config entirely and we're also not going to worry much about 2.3 because as stated earlier, 2.4 has been out for a bit.

If we want to look at properly implementing cn=config then we should take a look at an existing implementation such as https://github.com/threatstack/ts-ldap which makes use of net-ldap. We'll keep this as a feature request and happily review PRs for said functionality but currently we only support slapd.conf for configuration.

@cheeseplus
Copy link

After some discussion with @iennae we've decided that at the very least we should add a note to the readme explaining this so that it's easily searchable and once that is done, close this issue, and implement this as a project breaking it down into smaller issues as tasks.

@jof
Copy link
Author

jof commented Jul 31, 2017

+1 on your proposed path forward, @cheeseplus.
I think having very explicit textual configuration makes a lot more sense for configuration management than to support online configuration changes, which opaquely live in a database.

Calling out this choice in the README seems like the right thing to do.

@damacus damacus added the Feature Request Enhancement to existing functionality or new functionality label Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Enhancement to existing functionality or new functionality
Projects
None yet
Development

No branches or pull requests

5 participants