Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ldap parameters #1352

Merged
merged 2 commits into from
Feb 1, 2016
Merged
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
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1508,13 +1508,23 @@ Installs and configures [`mod_ldap`][]. Allows you to modify the
class { 'apache::mod::ldap':
ldap_trusted_global_cert_file => '/etc/pki/tls/certs/ldap-trust.crt'
ldap_trusted_global_cert_type => 'CA_DER',
ldap_shared_cache_size => '500000',
ldap_cache_entries => '1024',
ldap_cache_ttl => '600',
ldap_opcache_entries => '1024',
ldap_opcache_ttl => '600',
}
~~~

**Parameters within `apache::mod::ldap`:**

- `ldap_trusted_global_cert_file`: Path and file name of the trusted CA certificates to use when establishing SSL or TLS connections to an LDAP server.
- `ldap_trusted_global_cert_type`: The global trust certificate format. Defaults to 'CA_BASE64'.
- `ldap_shared_cache_size`: Size in bytes of the shared-memory cache.
- `ldap_cache_entries`: Maximum number of entries in the primary LDAP cache.
- `ldap_cache_ttl`: Time that cached items remain valid.
- `ldap_opcache_entries`: Number of entries used to cache LDAP compare operations.
- `ldap_opcache_ttl`: Time that entries in the operation cache remain valid.

##### Class: `apache::mod::negotiation`

Expand Down
5 changes: 5 additions & 0 deletions manifests/mod/ldap.pp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
$apache_version = $::apache::apache_version,
$ldap_trusted_global_cert_file = undef,
$ldap_trusted_global_cert_type = 'CA_BASE64',
$ldap_shared_cache_size = undef,
$ldap_cache_entries = undef,
$ldap_cache_ttl = undef,
$ldap_opcache_entries = undef,
$ldap_opcache_ttl = undef,
){
if ($ldap_trusted_global_cert_file) {
validate_string($ldap_trusted_global_cert_type)
Expand Down
14 changes: 12 additions & 2 deletions spec/classes/mod/ldap_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,22 @@
it { is_expected.to contain_file('ldap.conf').with_content(/^LDAPTrustedGlobalCert CA_BASE64 ca\.pem$/) }
end

context 'ldap_trusted_global_cert_file and ldap_trusted_global_cert_type params' do
context 'set multiple ldap params' do
let(:params) {{
:ldap_trusted_global_cert_file => 'ca.pem',
:ldap_trusted_global_cert_type => 'CA_DER'
:ldap_trusted_global_cert_type => 'CA_DER',
:ldap_shared_cache_size => '500000',
:ldap_cache_entries => '1024',
:ldap_cache_ttl => '600',
:ldap_opcache_entries => '1024',
:ldap_opcache_ttl => '600'
}}
it { is_expected.to contain_file('ldap.conf').with_content(/^LDAPTrustedGlobalCert CA_DER ca\.pem$/) }
it { is_expected.to contain_file('ldap.conf').with_content(/^LDAPSharedCacheSize 500000$/) }
it { is_expected.to contain_file('ldap.conf').with_content(/^LDAPCacheEntries 1024$/) }
it { is_expected.to contain_file('ldap.conf').with_content(/^LDAPCacheTTL 600$/) }
it { is_expected.to contain_file('ldap.conf').with_content(/^LDAPOpCacheEntries 1024$/) }
it { is_expected.to contain_file('ldap.conf').with_content(/^LDAPOpCacheTTL 600$/) }
end
end #Debian

Expand Down
15 changes: 15 additions & 0 deletions templates/mod/ldap.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,18 @@
<% if @ldap_trusted_global_cert_file -%>
LDAPTrustedGlobalCert <%= @ldap_trusted_global_cert_type %> <%= @ldap_trusted_global_cert_file %>
<% end -%>
<%- if @ldap_shared_cache_size -%>
LDAPSharedCacheSize <%= @ldap_shared_cache_size %>
<%- end -%>
<%- if @ldap_cache_entries -%>
LDAPCacheEntries <%= @ldap_cache_entries %>
<%- end -%>
<%- if @ldap_cache_ttl -%>
LDAPCacheTTL <%= @ldap_cache_ttl %>
<%- end -%>
<%- if @ldap_opcache_entries -%>
LDAPOpCacheEntries <%= @ldap_opcache_entries %>
<%- end -%>
<%- if @ldap_opcache_ttl -%>
LDAPOpCacheTTL <%= @ldap_opcache_ttl %>
<%- end -%>