Skip to content

Commit 4ab126b

Browse files
authored
Merge pull request #398 from edrude/postfix-ldap
postfix-ldap required for ldap lookup type on RHEL8+
2 parents d4058dc + e310c49 commit 4ab126b

File tree

5 files changed

+18
-4
lines changed

5 files changed

+18
-4
lines changed

REFERENCE.md

+9
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ The following parameters are available in the `postfix` class:
100100
* [`ldap_base`](#-postfix--ldap_base)
101101
* [`ldap_host`](#-postfix--ldap_host)
102102
* [`ldap_options`](#-postfix--ldap_options)
103+
* [`ldap_packages`](#-postfix--ldap_packages)
103104
* [`lookup_table_type`](#-postfix--lookup_table_type)
104105
* [`mail_user`](#-postfix--mail_user)
105106
* [`mailman`](#-postfix--mailman)
@@ -257,6 +258,14 @@ Example: `start_tls = yes`.
257258

258259
Default value: `undef`
259260

261+
##### <a name="-postfix--ldap_packages"></a>`ldap_packages`
262+
263+
Data type: `Array[String[1]]`
264+
265+
An array of package names to install for LDAP support if $ldap is true.
266+
267+
Default value: `[]`
268+
260269
##### <a name="-postfix--lookup_table_type"></a>`lookup_table_type`
261270

262271
Data type: `String`

data/osfamily/Debian.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
---
22
postfix::params::mailx_package: 'bsd-mailx'
33
postfix::params::master_os_template: 'postfix/master.cf.debian.erb'
4+
postfix::ldap_packages: ['postfix-ldap']
45
...

data/osfamily/RedHat/9.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22

33
postfix::params::mailx_package: 's-nail'
4+
postfix::ldap_packages: ['postfix-ldap']

manifests/init.pp

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@
8686
# A free form string that can define any LDAP options to be passed through (ldap_table(5)).
8787
# Example: `start_tls = yes`.
8888
#
89+
# @param ldap_packages
90+
# An array of package names to install for LDAP support if $ldap is true.
91+
#
8992
# @param lookup_table_type
9093
# Table format type as described in http://www.postfix.org/DATABASE_README.html#types.
9194
# Type has to be supported by system, see "postconf -m" for supported types.
@@ -262,6 +265,7 @@
262265
Optional[String] $ldap_base = undef,
263266
Optional[String] $ldap_host = undef,
264267
Optional[String] $ldap_options = undef,
268+
Array[String[1]] $ldap_packages = [],
265269
String $lookup_table_type = 'hash',
266270
String $mail_user = 'vmail', # postfix_mail_user
267271
Boolean $mailman = false,

manifests/ldap.pp

+3-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
assert_type(String, $postfix::ldap_host)
99
assert_type(String, $postfix::ldap_options)
1010

11-
if $facts['os']['family'] == 'Debian' {
12-
package { 'postfix-ldap':
13-
before => File["${postfix::confdir}/ldap-aliases.cf"],
14-
}
11+
package { $postfix::ldap_packages:
12+
ensure => installed,
13+
before => File["${postfix::confdir}/ldap-aliases.cf"],
1514
}
1615

1716
if ! $postfix::ldap_base {

0 commit comments

Comments
 (0)