Commit 8b0cd58a authored by Raphaël Pinson's avatar Raphaël Pinson
Browse files

Add missing variables for ldap

parent 3f7ca33b
......@@ -11,6 +11,10 @@
#
# [*ldap_base*] - (string)
#
# [*ldap_host*] - (string)
#
# [*ldap_options*] - (string)
#
# [*mail_user*] - (string) The mail user
#
# [*mailman*] - (boolean)
......@@ -60,6 +64,8 @@ class postfix (
$inet_interfaces = 'all',
$ldap = false,
$ldap_base = undef,
$ldap_host = undef,
$ldap_options = undef,
$mail_user = 'vmail', # postfix_mail_user
$mailman = false,
$maincf_source = "puppet:///modules/${module_name}/main.cf",
......@@ -93,6 +99,8 @@ class postfix (
validate_string($inet_interfaces)
validate_string($ldap_base)
validate_string($ldap_host)
validate_string($ldap_options)
validate_string($mail_user)
validate_string($maincf_source)
validate_string($mastercf_source)
......
......@@ -6,6 +6,16 @@ class postfix::ldap {
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':
ensure => present,
owner => root,
......
# File managed by puppet
<% if has_variable?("postfix_ldap_host") -%>
server_host = <%= postfix_ldap_host %>
<% else -%>
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 %>
server_host = <%= @ldap_host %>
<% if @ldap_base -%>
search_base = <%= @ldap_base %>
<% end -%>
<%= @ldap_options %>
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