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

Add missing variables for ldap

parent 3f7ca33b
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,10 @@ ...@@ -11,6 +11,10 @@
# #
# [*ldap_base*] - (string) # [*ldap_base*] - (string)
# #
# [*ldap_host*] - (string)
#
# [*ldap_options*] - (string)
#
# [*mail_user*] - (string) The mail user # [*mail_user*] - (string) The mail user
# #
# [*mailman*] - (boolean) # [*mailman*] - (boolean)
...@@ -60,6 +64,8 @@ class postfix ( ...@@ -60,6 +64,8 @@ class postfix (
$inet_interfaces = 'all', $inet_interfaces = 'all',
$ldap = false, $ldap = false,
$ldap_base = undef, $ldap_base = undef,
$ldap_host = undef,
$ldap_options = 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",
...@@ -93,6 +99,8 @@ class postfix ( ...@@ -93,6 +99,8 @@ class postfix (
validate_string($inet_interfaces) validate_string($inet_interfaces)
validate_string($ldap_base) validate_string($ldap_base)
validate_string($ldap_host)
validate_string($ldap_options)
validate_string($mail_user) validate_string($mail_user)
validate_string($maincf_source) validate_string($maincf_source)
validate_string($mastercf_source) validate_string($mastercf_source)
......
...@@ -6,6 +6,16 @@ class postfix::ldap { ...@@ -6,6 +6,16 @@ class postfix::ldap {
fail 'Missing $postfix_ldap_base !' fail 'Missing $postfix_ldap_base !'
} }
$ldap_host = $postfix::ldap_host ? {
undef => 'localhost',
default => $postfix::ldap_host,
}
$ldap_base = $postfix::ldap_base
$ldap_options = $postfix::ldap_options ? {
undef => '',
default => $postfix::ldap_options,
}
file {'/etc/postfix/ldap-aliases.cf': file {'/etc/postfix/ldap-aliases.cf':
ensure => present, ensure => present,
owner => root, owner => root,
......
# File managed by puppet # File managed by puppet
<% if has_variable?("postfix_ldap_host") -%> server_host = <%= @ldap_host %>
server_host = <%= postfix_ldap_host %> <% if @ldap_base -%>
<% else -%> search_base = <%= @ldap_base %>
server_host = localhost
<% end -%>
<% if has_variable?("postfix_ldap_base") -%>
search_base = <%= postfix_ldap_base %>
<% end -%>
<% if has_variable?('postfix_ldap_options') -%>
<%= postfix_ldap_options %>
<% end -%> <% end -%>
<%= @ldap_options %>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment