Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,8 @@ The following parameters are available in the `openldap::server` class:

* [`krb5_keytab_file`](#-openldap--server--krb5_keytab_file)
* [`krb5_client_keytab_file`](#-openldap--server--krb5_client_keytab_file)
* [`pldap_ifs`](#-openldap--server--pldap_ifs)
* [`pldaps_ifs`](#-openldap--server--pldaps_ifs)
* [`package`](#-openldap--server--package)
* [`confdir`](#-openldap--server--confdir)
* [`conffile`](#-openldap--server--conffile)
Expand Down Expand Up @@ -502,6 +504,26 @@ configuring sasl with backend GSSAPI

Default value: `undef`

##### <a name="-openldap--server--pldap_ifs"></a>`pldap_ifs`

Data type: `Array[String[1]]`

Allows to configure the HAProxy PROXY protol handling of openldap.
This allows to get IPs of clients through a load-balancer for logging or filtering.
Must not use the same ports as the native listeners.

Default value: `[]`

##### <a name="-openldap--server--pldaps_ifs"></a>`pldaps_ifs`

Data type: `Array[String[1]]`

Allows to configure the HAProxy PROXY protol handling of openldap.
This allows to get IPs of clients through a load-balancer for logging or filtering.
Must not use the same ports as the native listeners.

Default value: `[]`

##### <a name="-openldap--server--package"></a>`package`

Data type: `String[1]`
Expand Down
10 changes: 10 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
# @param krb5_client_keytab_file
# if set, manage the env variable KRB5_CLIENT_KTNAME on Debian based operating systems. This is required when
# configuring sasl with backend GSSAPI
# @param pldap_ifs
# Allows to configure the HAProxy PROXY protol handling of openldap.
# This allows to get IPs of clients through a load-balancer for logging or filtering.
# Must not use the same ports as the native listeners.
# @param pldaps_ifs
# Allows to configure the HAProxy PROXY protol handling of openldap.
# This allows to get IPs of clients through a load-balancer for logging or filtering.
# Must not use the same ports as the native listeners.
class openldap::server (
String[1] $package,
String[1] $confdir,
Expand All @@ -27,6 +35,8 @@
Hash $databases = {},
Array[String[1]] $ldap_ifs = ['/'],
Array[String[1]] $ldaps_ifs = [],
Array[String[1]] $pldaps_ifs = [],
Array[String[1]] $pldap_ifs = [],
Optional[String] $slapd_params = undef,
Optional[Stdlib::Port] $ldap_port = undef,
Optional[Stdlib::IP::Address] $ldap_address = undef,
Expand Down
10 changes: 9 additions & 1 deletion manifests/server/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
$ldap_config_backend = $openldap::server::ldap_config_backend
$enable_memory_limit = $openldap::server::enable_memory_limit

$slapd_pldap_ifs = empty($openldap::server::pldap_ifs) ? {
false => join(prefix($openldap::server::pldap_ifs, 'pldap://'), ' '),
true => '',
}
$slapd_ldap_ifs = empty($openldap::server::ldap_ifs) ? {
false => join(prefix($openldap::server::ldap_ifs, 'ldap://'), ' '),
true => '',
Expand All @@ -29,11 +33,15 @@
false => join(prefix($escaped_ldapi_ifs, 'ldapi://'), ' '),
true => '',
}
$slapd_pldaps_ifs = empty($openldap::server::pldaps_ifs) ? {
false => join(prefix($openldap::server::pldaps_ifs, 'pldaps://'), ' '),
true => '',
}
$slapd_ldaps_ifs = empty($openldap::server::ldaps_ifs) ? {
false => join(prefix($openldap::server::ldaps_ifs, 'ldaps://'), ' '),
true => '',
}
$slapd_ldap_urls = "${slapd_ldap_ifs} ${slapd_ldapi_ifs} ${slapd_ldaps_ifs}"
$slapd_ldap_urls = "${slapd_ldap_ifs} ${slapd_pldap_ifs} ${slapd_ldapi_ifs} ${slapd_ldaps_ifs} ${slapd_pldaps_ifs}"

file { $openldap::server::confdir:
ensure => directory,
Expand Down
29 changes: 29 additions & 0 deletions spec/acceptance/openldap__server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,33 @@
end
end
end

skip('Does not work on openldap 2.4') if (fact('os.family') == 'Debian' && fact('os.release.major') == 11) ||
(fact('os.family') == 'RedHat' && fact('os.release.major') == 8)
context 'when enabling PROXY Protocol' do
it 'idempotentlies run' do

Check failure on line 86 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Rocky 8

openldap::server when enabling PROXY Protocol idempotentlies run Failure/Error: apply_manifest(pp, catch_failures: true) Beaker::Host::CommandFailure: Host 'rocky8-64-openvox8.example.com' exited with 6 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_132259076.TQsSj4.pp Last 10 lines of output were: Nov 28 13:21:40 rocky8-64-openvox8.example.com slapd[1068]: daemon: shutdown requested and initiated. Nov 28 13:21:40 rocky8-64-openvox8.example.com systemd[1]: Stopping OpenLDAP Server Daemon... Nov 28 13:21:40 rocky8-64-openvox8.example.com slapd[1068]: slapd shutdown: waiting for 0 operations/tasks to finish �[mNotice: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCertificate]/Openldap_global_conf[TLSCertificate]: Dependency Service[slapd] has failures: true Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCertificate]/Openldap_global_conf[TLSCertificate]: Skipping because of failed dependencies Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCACertificateFile]/Openldap_global_conf[TLSCACertificateFile]: Skipping because of failed dependencies Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Database[dc=my-domain,dc=com]/Openldap_database[dc=my-domain,dc=com]: Skipping because of failed dependencies Info: Stage[main]: Unscheduling all events on Stage[main] �[mNotice: Applied catalog in 0.38 seconds

Check failure on line 86 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Debian 11

openldap::server when enabling PROXY Protocol idempotentlies run Failure/Error: apply_manifest(pp, catch_failures: true) Beaker::Host::CommandFailure: Host 'debian11-64-openvox8.example.com' exited with 6 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_132303256.WoiHvO.pp Last 10 lines of output were: Nov 28 13:22:14 debian11-64-openvox8.example.com slapd[2771]: Starting OpenLDAP: slapd. Nov 28 13:22:14 debian11-64-openvox8.example.com systemd[1]: Started LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol). Nov 28 13:22:31 debian11-64-openvox8.example.com systemd[1]: Stopping LSB: OpenLDAP standalone server (Lightweight Directory Access Protocol)... Nov 28 13:22:31 debian11-64-openvox8.example.com slapd[2777]: daemon: shutdown requested and initiated. �[mNotice: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCertificate]/Openldap_global_conf[TLSCertificate]: Dependency Service[slapd] has failures: true Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCertificate]/Openldap_global_conf[TLSCertificate]: Skipping because of failed dependencies Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCACertificateFile]/Openldap_global_conf[TLSCACertificateFile]: Skipping because of failed dependencies Info: Stage[main]: Unscheduling all events on Stage[main] �[mNotice: Applied catalog in 0.70 seconds

Check failure on line 86 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - AlmaLinux 8

openldap::server when enabling PROXY Protocol idempotentlies run Failure/Error: apply_manifest(pp, catch_failures: true) Beaker::Host::CommandFailure: Host 'almalinux8-64-openvox8.example.com' exited with 6 running: puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest_132258901.vzlt4T.pp Last 10 lines of output were: Nov 28 13:21:42 almalinux8-64-openvox8.example.com slapd[1129]: daemon: shutdown requested and initiated. Nov 28 13:21:42 almalinux8-64-openvox8.example.com systemd[1]: Stopping OpenLDAP Server Daemon... Nov 28 13:21:42 almalinux8-64-openvox8.example.com slapd[1129]: slapd shutdown: waiting for 0 operations/tasks to finish �[mNotice: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCertificate]/Openldap_global_conf[TLSCertificate]: Dependency Service[slapd] has failures: true Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCertificate]/Openldap_global_conf[TLSCertificate]: Skipping because of failed dependencies Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Globalconf[TLSCACertificateFile]/Openldap_global_conf[TLSCACertificateFile]: Skipping because of failed dependencies Warning: /Stage[main]/Openldap::Server::Slapdconf/Openldap::Server::Database[dc=my-domain,dc=com]/Openldap_database[dc=my-domain,dc=com]: Skipping because of failed dependencies Info: Stage[main]: Unscheduling all events on Stage[main] �[mNotice: Applied catalog in 0.40 seconds
pp = <<-EOS
class { 'openldap::server':
ldaps_ifs => ['/'],
ssl_key => "/etc/ldap/ssl/${facts['networking']['fqdn']}.key",
ssl_cert => "/etc/ldap/ssl/${facts['networking']['fqdn']}.crt",
ssl_ca => '/etc/ldap/ssl/ca.pem',
pldaps_ifs => ['[::]:3269/'],
pldap_ifs => ['[::]:7389/'],
}
EOS

idempotent_apply(pp)
end

# rubocop:disable RSpec/RepeatedExampleGroupBody
describe port(7389) do
it { is_expected.to be_listening }

Check failure on line 103 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Rocky 8

openldap::server when enabling PROXY Protocol Port "7389" is expected to be listening Failure/Error: it { is_expected.to be_listening } expected Port "7389" to be listening

Check failure on line 103 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Debian 11

openldap::server when enabling PROXY Protocol Port "7389" is expected to be listening Failure/Error: it { is_expected.to be_listening } expected Port "7389" to be listening

Check failure on line 103 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - AlmaLinux 8

openldap::server when enabling PROXY Protocol Port "7389" is expected to be listening Failure/Error: it { is_expected.to be_listening } expected Port "7389" to be listening
end

describe port(3269) do
it { is_expected.to be_listening }

Check failure on line 107 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Rocky 8

openldap::server when enabling PROXY Protocol Port "3269" is expected to be listening Failure/Error: it { is_expected.to be_listening } expected Port "3269" to be listening

Check failure on line 107 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - Debian 11

openldap::server when enabling PROXY Protocol Port "3269" is expected to be listening Failure/Error: it { is_expected.to be_listening } expected Port "3269" to be listening

Check failure on line 107 in spec/acceptance/openldap__server_spec.rb

View workflow job for this annotation

GitHub Actions / Puppet / OpenVox 8 - AlmaLinux 8

openldap::server when enabling PROXY Protocol Port "3269" is expected to be listening Failure/Error: it { is_expected.to be_listening } expected Port "3269" to be listening
end
# rubocop:enable RSpec/RepeatedExampleGroupBody
end
end
Loading