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

Rework default database lifecycle on Debian #372

Merged
merged 4 commits into from Apr 13, 2023
Merged

Rework default database lifecycle on Debian #372

merged 4 commits into from Apr 13, 2023

Conversation

smortex
Copy link
Member

@smortex smortex commented Apr 3, 2023

When Debian install slapd, it configure it by default with a database that match the hostname unless overridden by a preseed file as we did before. We did remove this database, however this has consequences on the first database created by the module and prevent it from being restored after being dumped (#366).

This PR remove database name customization and request no_configuration from the preseed file. This requires us to bootstrap the cn=config database, but also prevent the package from installing correctly (709472). To workaround this new issue, setup a policy-rc.d so that the service is not started at the post-install stage. Because policy-rc.d is a system-wide script, we hope to cause conflicts with infrastructures which have a custom one. We therefore provide a new flag to opt-out from managing this file from the repo.

Existing databases which cannot be dumped/restored are not fixed, but new deployment should not have this issue.

Fixes #366

@smortex smortex force-pushed the 366 branch 5 times, most recently from 3accf34 to 588c271 Compare April 4, 2023 00:10
@smortex smortex linked an issue Apr 4, 2023 that may be closed by this pull request
@smortex smortex force-pushed the 366 branch 7 times, most recently from bb4c275 to c8242dd Compare April 4, 2023 01:41
@smortex smortex changed the title Improve database creation on Debian Fix database creation on Debian Apr 4, 2023
@smortex smortex force-pushed the 366 branch 9 times, most recently from 289f553 to f6bc04c Compare April 4, 2023 03:54
@smortex smortex changed the title Fix database creation on Debian Rework default database lifecycle on Debian Apr 4, 2023
@smortex smortex marked this pull request as ready for review April 4, 2023 22:25
This can spot some inconsistence issues where OpenLDAP is working
correctly but a dump is not restorable, as spotted in #366.
When Debian install slapd, it configure it by default with a database
that match the hostname unless overriden by a preseed file as we did
before.  This however has consequences on the database created by the
module that prevent it from being restored after being dumped.

Remove this custom database name and request no_configuration from the
preseed file.  This requires us to bootstrap the cn=config database, but
also prevent the package from installing correctly ([709472]).  Systemd
presets files unfortunately do not help here, so rely on invoke-rc.d(8)
to skip service management completly.

Fixes #366

[709472]:https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=709472
The RedHat cleanup is still required but at least on RedHat we do not
have the dump/restore issues we had on Debian.

Adjust slightly the RedHad config that seems to have a few missing bits.
Unfortunately, we can't count on a better system than `policy-rc.d(8)`
on Debian for preventing the service from starting on package
installation.  Some systems administrators might have system-wide
configuration to never start any service, and they will not want to have
this file managed in an uncontrolled way by the module.

We assume that these administrators already have a `file` resource to
manage this script, and that the default configuration will cause
conflicts and the catalog will not be built.  By disabling this script
management in the module, administrators will revert to their previous
behavior, after having a chance to adjust their own script if needed.
@smortex smortex merged commit f335f78 into master Apr 13, 2023
26 checks passed
@smortex smortex deleted the 366 branch April 13, 2023 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dc=my-domain,dc=com entry in Database
2 participants