File tree Expand file tree Collapse file tree 4 files changed +71
-1
lines changed Expand file tree Collapse file tree 4 files changed +71
-1
lines changed Original file line number Diff line number Diff line change @@ -453,6 +453,8 @@ The following parameters are available in the `openldap::server` class:
453453
454454* [ ` krb5_keytab_file ` ] ( #-openldap--server--krb5_keytab_file )
455455* [ ` krb5_client_keytab_file ` ] ( #-openldap--server--krb5_client_keytab_file )
456+ * [ ` pldap_ifs ` ] ( #-openldap--server--pldap_ifs )
457+ * [ ` pldaps_ifs ` ] ( #-openldap--server--pldaps_ifs )
456458* [ ` package ` ] ( #-openldap--server--package )
457459* [ ` confdir ` ] ( #-openldap--server--confdir )
458460* [ ` conffile ` ] ( #-openldap--server--conffile )
@@ -502,6 +504,26 @@ configuring sasl with backend GSSAPI
502504
503505Default value: ` undef `
504506
507+ ##### <a name =" -openldap--server--pldap_ifs " ></a >` pldap_ifs `
508+
509+ Data type: ` Array[String[1]] `
510+
511+ Allows to configure the HAProxy PROXY protol handling of openldap.
512+ This allows to get IPs of clients through a load-balancer for logging or filtering.
513+ Must not use the same ports as the native listeners.
514+
515+ Default value: ` [] `
516+
517+ ##### <a name =" -openldap--server--pldaps_ifs " ></a >` pldaps_ifs `
518+
519+ Data type: ` Array[String[1]] `
520+
521+ Allows to configure the HAProxy PROXY protol handling of openldap.
522+ This allows to get IPs of clients through a load-balancer for logging or filtering.
523+ Must not use the same ports as the native listeners.
524+
525+ Default value: ` [] `
526+
505527##### <a name =" -openldap--server--package " ></a >` package `
506528
507529Data type: ` String[1] `
Original file line number Diff line number Diff line change 55# @param krb5_client_keytab_file
66# if set, manage the env variable KRB5_CLIENT_KTNAME on Debian based operating systems. This is required when
77# configuring sasl with backend GSSAPI
8+ # @param pldap_ifs
9+ # Allows to configure the HAProxy PROXY protol handling of openldap.
10+ # This allows to get IPs of clients through a load-balancer for logging or filtering.
11+ # Must not use the same ports as the native listeners.
12+ # @param pldaps_ifs
13+ # Allows to configure the HAProxy PROXY protol handling of openldap.
14+ # This allows to get IPs of clients through a load-balancer for logging or filtering.
15+ # Must not use the same ports as the native listeners.
816class openldap::server (
917 String[1] $package,
1018 String[1] $confdir,
2735 Hash $databases = {},
2836 Array[String[1]] $ldap_ifs = [' /' ],
2937 Array[String[1]] $ldaps_ifs = [],
38+ Array[String[1]] $pldaps_ifs = [],
39+ Array[String[1]] $pldap_ifs = [],
3040 Optional[String] $slapd_params = undef ,
3141 Optional[Stdlib::Port] $ldap_port = undef ,
3242 Optional[Stdlib::IP::Address] $ldap_address = undef ,
Original file line number Diff line number Diff line change 1717 $ldap_config_backend = $openldap::server::ldap_config_backend
1818 $enable_memory_limit = $openldap::server::enable_memory_limit
1919
20+ $slapd_pldap_ifs = empty($openldap::server::pldap_ifs ) ? {
21+ false => join(prefix($openldap::server::pldap_ifs , ' pldap://' ), ' ' ),
22+ true => ' ' ,
23+ }
2024 $slapd_ldap_ifs = empty($openldap::server::ldap_ifs ) ? {
2125 false => join(prefix($openldap::server::ldap_ifs , ' ldap://' ), ' ' ),
2226 true => ' ' ,
2933 false => join(prefix($escaped_ldapi_ifs , ' ldapi://' ), ' ' ),
3034 true => ' ' ,
3135 }
36+ $slapd_pldaps_ifs = empty($openldap::server::pldaps_ifs ) ? {
37+ false => join(prefix($openldap::server::pldaps_ifs , ' pldaps://' ), ' ' ),
38+ true => ' ' ,
39+ }
3240 $slapd_ldaps_ifs = empty($openldap::server::ldaps_ifs ) ? {
3341 false => join(prefix($openldap::server::ldaps_ifs , ' ldaps://' ), ' ' ),
3442 true => ' ' ,
3543 }
36- $slapd_ldap_urls = " ${slapd_ldap_ifs} ${slapd_ldapi_ifs} ${slapd_ldaps_ifs} "
44+ $slapd_ldap_urls = " ${slapd_ldap_ifs} ${slapd_pldap_ifs} ${ slapd_ldapi_ifs} ${slapd_ldaps_ifs} ${slapd_pldaps_ifs }"
3745
3846 file { $openldap::server::confdir :
3947 ensure => directory ,
Original file line number Diff line number Diff line change @@ -79,4 +79,34 @@ class { 'openldap::server':
7979 end
8080 end
8181 end
82+
83+ # if (fact('os.family') == 'Debian' && fact('os.release.major') == 11) ||
84+ # (fact('os.family') == 'RedHat' && fact('os.release.major') == 8)
85+ skip ( 'Does not work on openldap 2.4' )
86+ context 'when enabling PROXY Protocol' do
87+ it 'idempotentlies run' do
88+ pp = <<-EOS
89+ class { 'openldap::server':
90+ ldaps_ifs => ['/'],
91+ ssl_key => "/etc/ldap/ssl/${facts['networking']['fqdn']}.key",
92+ ssl_cert => "/etc/ldap/ssl/${facts['networking']['fqdn']}.crt",
93+ ssl_ca => '/etc/ldap/ssl/ca.pem',
94+ pldaps_ifs => ['[::]:3269/'],
95+ pldap_ifs => ['[::]:7389/'],
96+ }
97+ EOS
98+
99+ idempotent_apply ( pp )
100+ end
101+
102+ # rubocop:disable RSpec/RepeatedExampleGroupBody
103+ describe port ( 7389 ) do
104+ it { is_expected . to be_listening }
105+ end
106+
107+ describe port ( 3269 ) do
108+ it { is_expected . to be_listening }
109+ end
110+ # rubocop:enable RSpec/RepeatedExampleGroupBody
111+ end
82112end
You can’t perform that action at this time.
0 commit comments