Skip to content
Snippets Groups Projects
Commit 3f7ca33b authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

postfix::ldap

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