Unverified Commit f1016453 authored by marcusdots's avatar marcusdots Committed by GitHub
Browse files

Merge pull request #455 from marcusdots/ldap_bind_password

separate `ldap_bind_pw` so it may have an eyaml entry
parents 2c745ffc 831c76e4
Loading
Loading
Loading
Loading
+11 −2
Changes for REFERENCE.md: 11 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -104,6 +104,7 @@ The following parameters are available in the `postfix` class:
* [`ldap_base`](#-postfix--ldap_base)
* [`ldap_host`](#-postfix--ldap_host)
* [`ldap_options`](#-postfix--ldap_options)
* [`ldap_bind_pw`](#-postfix--ldap_bind_pw)
* [`ldap_packages`](#-postfix--ldap_packages)
* [`lookup_table_type`](#-postfix--lookup_table_type)
* [`mailaliases`](#-postfix--mailaliases)
@@ -258,13 +259,21 @@ Default value: `undef`

##### <a name="-postfix--ldap_options"></a>`ldap_options`

Data type: `Optional[String]`
Data type: `Optional[Variant[String[1],Array[String[1]]]]`

A free form string that can define any LDAP options to be passed through (ldap_table(5)).
A free form string or array of strings that can define any LDAP options to be passed through (ldap_table(5)).
Example: `start_tls = yes`.

Default value: `undef`

##### <a name="-postfix--ldap_bind_pw"></a>`ldap_bind_pw`

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

A password that is to be provided separately (eyaml) from ldap_options

Default value: `undef`

##### <a name="-postfix--ldap_packages"></a>`ldap_packages`

Data type: `Array[String[1]]`
+6 −2
Changes for manifests/init.pp: 6 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -83,9 +83,12 @@
#   Example: `ldaps://ldap.example.com:636 ldap://ldap2.example.com`.
#
# @param ldap_options
#   A free form string that can define any LDAP options to be passed through (ldap_table(5)).
#   A free form string or array of strings that can define any LDAP options to be passed through (ldap_table(5)).
#   Example: `start_tls = yes`.
#
# @param ldap_bind_pw
#   A password that is to be provided separately (eyaml) from ldap_options
#
# @param ldap_packages
#   An array of package names to install for LDAP support if $ldap is true.
#
@@ -276,7 +279,8 @@ class postfix (
  Boolean $ldap = false,
  Optional[String] $ldap_base = undef,
  Optional[String] $ldap_host = undef,
  Optional[String] $ldap_options = undef,
  Optional[Variant[String[1],Array[String[1]]]] $ldap_options = undef,
  Optional[String[1]] $ldap_bind_pw = undef,
  Array[String[1]] $ldap_packages = [],
  String $lookup_table_type = 'hash',
  Hash $mailaliases = {},
+3 −0
Changes for manifests/ldap.pp: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -7,6 +7,8 @@ class postfix::ldap {
  assert_type(String, $postfix::ldap_base)
  assert_type(String, $postfix::ldap_host)
  assert_type(String, $postfix::ldap_options)
  assert_type(Optional[String], $postfix::ldap_bind_pw)
  assert_type(Optional[Variant[String[1],Array[String[1]]]], $postfix::ldap_options)

  package { $postfix::ldap_packages:
    ensure => installed,
@@ -17,6 +19,7 @@ class postfix::ldap {
    fail 'Missing $postfix::ldap_base !'
  }

  $ldap_bind_pw = $postfix::ldap_bind_pw
  $ldap_host = $postfix::ldap_host ? {
    undef   => 'localhost',
    default => $postfix::ldap_host,
+11 −1
Changes for templates/postfix-ldap-aliases.cf.erb: 11 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -3,4 +3,14 @@ server_host = <%= @ldap_host %>
<% if @ldap_base -%>
search_base = <%= @ldap_base %>
<% end -%>
<%= @ldap_options %>
<%
if @ldap_options
  options = [ @ldap_options ].flatten
  if @ldap_bind_pw
    options.append('bind_pw = ' + @ldap_bind_pw )
  end
end
-%>
<% if options -%>
<%= options.join("\n") %>
<% end -%>