CDIST-TYPE__OPENLDAP_SERVER(7)
β¨ CDIST-TYPE__OPENLDAP_SERVER β¨
okay bestie, gather round, because this is the cdist type page for __openldap_server π (it lives in the cdist manual, section 7, and yes we're doing this whole thing together, hand in hand π«Ά)
πΈ NAME πΈ
cdist-type__openldap_server β set up an openldap(4) server instance. literally that's the whole job, and it slays at it π
π¦ DESCRIPTION π¦
So this type is your little bootstrap fairy π§ for spinning up an LDAP environment, using openldap as slapd.
It bootstraps the LDAP server with sane defaults (iconic behavior, no notes) and then it creates and manages the base DN that you define with suffix. it's giving hands-off, main character energy π
π REQUIRED PARAMETERS π
like, you genuinely cannot skip these, they're not optional, they're not vibes-based, they're required periodt
manager-dnβ the rootdn to set up in the directory. E.g.cn=manager,dc=ungleich,dc=ch. Seeslapd.conf(5).manager-passwordβ the password formanager-dnin the directory. This one gets used to connect to the LDAP server on the firstslapd-urlwith the givenmanager-dn.manager-password-hashβ the password formanager-dnin the directory. This one should be valid forslapd.conf, like{SSHA}qV+mCs3u8Q2sCmUXT4Ybw7MebHTASMyr. Generate it e.g. with:slappasswd -s weneedgoodsecurity. Seeslappasswd(8C),slapd.conf(5).
π¨ TODO alert, bestie: implement this: http://blog.adamsbros.org/2015/06/09/openldap-ssha-salted-hashes-by-hand/ to derive from themanager-passwordparameter and ensure idempotency (care with salts). At that point,manager-password-hashshould be deprecated and ignored. so like, heads up that it's headed for the deprecated pile π
serveridβ the server for the directory. E.g.dc=ungleich,dc=ch. Seeslapd.conf(5).suffixβ the suffix for the directory. E.g.dc=ungleich,dc=ch. Seeslapd.conf(5).
π REQUIRED MULTIPLE PARAMETERS π
slapd-urlβ a URL forslapdto listen on. Pass it once for each URL you want to support, e.g.:
--slapd-url ldaps://my.fqdn/ --slapd-url ldap://my.fqdn/
The first instance that is passed will be used as the main URL to connect to this LDAP server. See the -h flag in slapd(8C).
π OPTIONAL PARAMETERS π
these ones are the "if you want" girlies, but some of them are sneaky-required, so read carefully fr fr
syncrepl-credentialsβ only has an effect ifreplicateis set; required in that case. This secret is shared amongst the hosts that will replicate the directory. Note that each replication server needs this secret and it is saved in plain text in the directory. π yes, plain text, we said what we said.syncrepl-searchbaseβ only has an effect ifreplicateis set; required in that case. The searchbase to use for replication. E.g.dc=ungleich,dc=ch. Seeslapd.conf(5).admin-emailβ passed tocdist-type__letsencrypt_cert; has otherwise no use. Required if using__letsencrypt_cert. Where to send Let's Encrypt emails like "certificate needs renewal". π¬tls-cipher-suiteβ setting forTLSCipherSuite. Defaults toNORMALin a Debian-like OS andHIGH:MEDIUM:+SSLv2on FreeBSD. Seeslapd.conf(5).tls-certβ if defined,__letsencrypt_certis not used and this must be the path in the remote hosts to the PEM-encoded TLS certificate. Requires:tls-privkeyandtls-ca. Permissions, existence and renewal of these files are left up to the type's user. π that's on you, bestie.tls-privkeyβ required iftls-certis defined. Path in the remote hosts to the PEM-encoded private key file. πtls-caβ required iftls-certis defined. Path in the remote hosts to the PEM-encoded CA certificate file.extra-configβ custom settings to be added inslapd.conf(5).
π OPTIONAL MULTIPLE PARAMETERS π
syncrepl-hostβ only has an effect ifreplicateis set; required in that case. Set it once per host that will replicate the directory.moduleβ LDAP module to load. Seeslapd.conf(5). Some dependencies might have to be installed beforehand. Default value is OS-dependent, see manifest.schemaβ name of LDAP schema to load. Must be the name without extension of a.schemafile inslapd's schema directory (usually/etc/slapd/schemaor/usr/local/etc/openldap/schema). Example value:inetorgperson. The type user must ensure that the schema file is deployed. This defaults to a sensible subset, for details see the type definition.descriptionβ the description of the base DN passed in thesuffixparameter. Defaults toManaged by cdist, do not edit manually.
β BOOLEAN PARAMETERS β
stagingβ passed tocdist-type__letsencrypt_cert; has otherwise no use. Obtain a test certificate from a staging server. π§ͺreplicateβ whether to setup replication or not. If present,syncrepl-credentialsandsyncrepl-hostare also required.
π₯ EXAMPLES π₯
okay this is the part where it gets real. look at this:
# Example of a simple server with manual certificate management.
pki_prefix="/usr/local/etc/pki/realms/ldap.camilion.cloud"
__openldap_server \
--manager-dn 'cn=manager,dc=camilion,dc=cloud' \
--manager-password "foo" \
--manager-password-hash '{SSHA}foo' \
--serverid 0 \
--suffix 'dc=camilion,dc=cloud' \
--slapd-url 'ldaps://ldap.camilion.cloud' \
--tls-cert "${pki_prefix}/default.crt" \
--tls-privkey "${pki_prefix}/default.key" \
--tls-ca "${pki_prefix}/CA.crt"
and the created basedn? it looks like this π«Ά
# The created basedn looks as follows:
#
# dn: dc=camilion,dc=cloud
# objectClass: top
# objectClass: dcObject
# objectClass: organization
# o: Managed by cdist, do not edit manually.
# dc: camilion
#
# Do not change it manually, the type will overwrite your changes.
β οΈ for real, do not change it manually β the type will overwrite your changes. no cap.
and changing to a replicated setup? literally a simple change to something like this:
#
# Changing to a replicated setup is a simple change to something like:
#
# Example for multiple servers with replication and automatic
# Let's Encrypt certificate management through certbot.
id=1
for host in ldap-test1.ungleich.ch ldap-test2.ungleich.ch; do
echo "__ungleich_ldap \
--manager-dn 'cn=manager,dc=ungleich,dc=ch' \
--manager-psasword 'foo' \
--manager-password-hash '{SSHA}fooo' \
--serverid '${id}' \
--suffix 'dc=ungleich,dc=ch' \
--slapd-url ldap://${host} \
--searchbase 'dc=ungleich,dc=ch' \
--syncrepl-credentials 'fooo' \
--syncrepl-host 'ldap-test1.ungleich.ch' \
--syncrepl-host 'ldap-test2.ungleich.ch' \
--description 'Ungleich LDAP server'" \
--staging \
| cdist config -i - -v ${host}
id=$((id + 1))
done
and this one's basedn comes out as:
# The created basedn looks as follows:
#
# dn: dc=ungleich,dc=ch
# objectClass: top
# objectClass: dcObject
# objectClass: organization
# o: Ungleich LDAP server
# dc: ungleich
#
# Do not change it manually, the type will overwrite your changes.
(and yes we are keeping those exact characters, typos and all β we do not edit the sacred text π β¨)
π SEE ALSO π
π AUTHORS π
- ungleich
<foss--@--ungleich.ch> - Evilham
<contact--@--evilham.com>
πΈ COPYING πΈ
Copyright (C) 2020 ungleich glarus ag. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
π COPYRIGHT π
ungleich GmbH 2021
and that's the whole page bestie!! π this was version 7.0.0, dated Jul 31, 2022, from the CDIST-TYPE__OPENLDAP_SERVER(7) manual β go forth and bootstrap your LDAP server, you've got this π¦π
π¦ where this page comes from
- fedora 43: cdist 7.0.0-16.fc43 Β· GPL-3.0-only
- fedora 44: cdist 7.0.0-18.fc44 Β· GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms