Commit 3f7ca33b authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

postfix::ldap

parent 22901939
......@@ -69,7 +69,7 @@ class postfix::files {
::postfix::config {
'myorigin': value => $myorigin;
'alias_maps': value => 'hash:/etc/aliases';
'alias_maps': value => $postfix::alias_maps;
'inet_interfaces': value => $inet_interfaces;
}
......
......@@ -7,10 +7,18 @@
# Parameters:
# [*inet_interfaces*] - (string)
#
# [*ldap*] - (boolean)
#
# [*ldap_base*] - (string)
#
# [*mail_user*] - (string) The mail user
#
# [*mailman*] - (boolean)
#
# [*maincf_source*] - (string)
#
# [*mastercf_source*] - (string)
#
# [*master_smtp*] - (string)
#
# [*master_smtps*] - (string)
......@@ -50,6 +58,8 @@
#
class postfix (
$inet_interfaces = 'all',
$ldap = false,
$ldap_base = undef,
$mail_user = 'vmail', # postfix_mail_user
$mailman = false,
$maincf_source = "puppet:///modules/${module_name}/main.cf",
......@@ -72,6 +82,7 @@ class postfix (
) inherits postfix::params {
validate_bool($ldap)
validate_bool($mailman)
validate_bool($mta)
validate_bool($satellite)
......@@ -81,7 +92,10 @@ class postfix (
validate_bool($use_sympa)
validate_string($inet_interfaces)
validate_string($ldap_base)
validate_string($mail_user)
validate_string($maincf_source)
validate_string($mastercf_source)
validate_string($master_smtp)
validate_string($master_smtps)
validate_string($mydestination)
......@@ -98,11 +112,20 @@ class postfix (
default => $smtp_listen,
}
$alias_maps = $ldap ? {
false => 'hash:/etc/aliases',
true => '"hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf"',
}
class { 'postfix::packages': } ->
class { 'postfix::files': } ~>
class { 'postfix::service': } ->
Class['postfix']
if $ldap {
include ::postfix::ldap
}
if $mta {
include ::postfix::mta
}
......
class postfix::ldap inherits postfix {
Postfix::Config['alias_maps'] {
value => '"hash:/etc/aliases, ldap:/etc/postfix/ldap-aliases.cf"',
}
class postfix::ldap {
package {'postfix-ldap': }
if ! $::postfix_ldap_base {
if ! $::postfix::ldap_base {
fail 'Missing $postfix_ldap_base !'
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment