Skip to content

Commit d7ebceb

Browse files
author
Joshua Hoblitt
committed
add missing $ldapserver param to pureftpd::config::ldap
1 parent 3f7ec70 commit d7ebceb

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

manifests/config/ldap.pp

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#
1414

1515
class pureftpd::config::ldap (
16+
$ldapserver = undef,
1617
$ldapport = undef,
1718
$ldapbinddn = undef,
1819
$ldapbindpw = undef,
@@ -30,6 +31,7 @@
3031

3132
# the complete list of options is defined in pure-ftpd/src/log_ldap_p.h
3233
$conf_options = [
34+
'LDAPServer',
3335
'LDAPPort',
3436
'LDAPBindDN',
3537
'LDAPBindPW',

spec/classes/config_ldap_spec.rb

+25-13
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,16 @@
1111
end
1212
end
1313

14+
describe 'with ldapserver' do
15+
let(:params) {{ :ldapserver => 'ldap.example.com' }}
16+
it do
17+
should contain_class('pureftpd::config::ldap')
18+
should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \
19+
.with_ensure('file') \
20+
.with_content(/^LDAPServer ldap.example.com/)
21+
end
22+
end
23+
1424
describe 'with ldapport' do
1525
let(:params) {{ :ldapport => '389' }}
1626
it do
@@ -153,26 +163,28 @@
153163

154164
describe 'with everything' do
155165
let(:params) {{
156-
:ldapauthmethod => 'PASSWORD',
157-
:ldapport => '389',
158-
:ldapbinddn => 'cn=Manager,dc=c9x,dc=org',
159-
:ldapbindpw => 'r00tPaSsw0rD',
160-
:ldapbasedn => 'cn=Users,dc=c9x,dc=org',
161-
:ldapfilter => '(&(objectClass=posixAccount)(uid=\L))',
162-
:ldaphomedir => 'homeDirectory',
163-
:ldapversion => '3',
164-
:ldapdefaultuid => '100',
166+
:ldapserver => 'ldap.example.com',
167+
:ldapauthmethod => 'PASSWORD',
168+
:ldapport => '389',
169+
:ldapbinddn => 'cn=Manager,dc=c9x,dc=org',
170+
:ldapbindpw => 'r00tPaSsw0rD',
171+
:ldapbasedn => 'cn=Users,dc=c9x,dc=org',
172+
:ldapfilter => '(&(objectClass=posixAccount)(uid=\L))',
173+
:ldaphomedir => 'homeDirectory',
174+
:ldapversion => '3',
175+
:ldapdefaultuid => '100',
165176
:ldapforcedefaultuid => 'False',
166-
:ldapdefaultgid => '100',
167-
:ldapdefaultgid => '100',
177+
:ldapdefaultgid => '100',
178+
:ldapdefaultgid => '100',
168179
:ldapforcedefaultgid => 'False',
169-
:ldapusetls => 'False',
170-
:ldapauthmethod => 'PASSWORD',
180+
:ldapusetls => 'False',
181+
:ldapauthmethod => 'PASSWORD',
171182
}}
172183
it do
173184
should contain_class('pureftpd::config::ldap')
174185
should contain_file('/etc/pure-ftpd/pureftpd-ldap.conf') \
175186
.with_ensure('file') \
187+
.with_content(/^LDAPServer ldap.example.com/) \
176188
.with_content(/^LDAPPort 389/) \
177189
.with_content(/^LDAPBindDN cn=Manager,dc=c9x,dc=org/) \
178190
.with_content(/^LDAPBindPW r00tPaSsw0rD/) \

0 commit comments

Comments
 (0)