Skip to content
This repository has been archived by the owner on Apr 21, 2023. It is now read-only.

Commit

Permalink
added test for ldap_port, plus version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
jorritfolmer committed Jan 29, 2019
1 parent 22f489f commit 0feeda2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
### 3.13.0

- Add service[managed] option to disable managing of the Splunk service
- Add ldap_port option

### 3.12.4

- Fix missing $ in $package_source variable
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -769,11 +769,12 @@ This is a hash with the following members:
- `saml_entityid` (defaults to $fqdn, override in search head clustering setups to make every search head use the same Relaying Party Trust in ADFS)
- `saml_fqdn` (not present by default, override in search head clustering setups to have ADFS redirect to this URL which should normally be the URL handled by a load balancer. If you omit this, ADFS will redirect to the individual search head that make de SAML request which isn't what you want in SHC)
- `ldap_host`
- `ldap_port`: optional if you use a non-standard port
- `ldap_binddn`
- `ldap_binddnpassword`
- `ldap_userbasedn`
- `ldap_groupbasedn`
- `ldap_sslenabled`
- `ldap_sslenabled`: default
- `ldap_usernameattribute`
- `ldap_groupmemberattribute`
- `ldap_groupnameattribute`
Expand Down
15 changes: 15 additions & 0 deletions spec/classes/init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,21 @@
it { should contain_class('splunk::installed') }
it { should contain_package('splunk') }
it { should contain_file('/opt/splunk/etc/apps/puppet_common_auth_ldap_base/local/authentication.conf').with_content(/bindDN = CN=sa_splunk,CN=Service Accounts,DC=internal,DC=corp,DC=tld/) }
it { should_not contain_file('/opt/splunk/etc/apps/puppet_common_auth_ldap_base/local/authentication.conf').with_content(/port = /) }
end

context 'with ldap auth on different port' do
let(:params) {
{
:auth => { 'authtype' => 'LDAP', 'ldap_host' => 'dc01.internal.corp.example', 'ldap_binddn' => 'CN=sa_splunk,CN=Service Accounts,DC=internal,DC=corp,DC=tld', 'ldap_binddnpassword' => 'changeme', 'ldap_port' => 12345},
:admin => { 'hash' => 'zzzz', 'fn' => 'yyyy', 'email' => 'wwww', },
:dontruncmds => true,
}
}
it { should contain_class('splunk::installed') }
it { should contain_package('splunk') }
it { should contain_file('/opt/splunk/etc/apps/puppet_common_auth_ldap_base/local/authentication.conf').with_content(/bindDN = CN=sa_splunk,CN=Service Accounts,DC=internal,DC=corp,DC=tld/) }
it { should contain_file('/opt/splunk/etc/apps/puppet_common_auth_ldap_base/local/authentication.conf').with_content(/port = 12345/) }
end

context 'with ldap auth and nestedgroups enabled' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ groupNameAttribute = <%= @auth_defaults['ldap_groupnameattribute'] %>
groupNameAttribute = <%= @auth['ldap_groupnameattribute'] %>
<% end -%>
host = <%= @auth['ldap_host'] %>
<% if not @auth['ldap_port'].nil? -%>
port = <%= @auth['ldap_port'] %>
<% end -%>
<% if not @auth['ldap_nestedgroups'].nil? -%>
nestedGroups = <%= @auth['ldap_nestedgroups'] %>
<% end -%>
Expand Down

0 comments on commit 0feeda2

Please sign in to comment.