From 54e5712716dd9e1470d0a2d3b40f56c16d76b1c8 Mon Sep 17 00:00:00 2001 From: Ossi Herrala Date: Wed, 3 Oct 2012 09:30:13 +0000 Subject: [PATCH] Add LDAP authentication support for saslauthd. --- sasl/manifests/init.pp | 18 ++++++++++++++++++ sasl/templates/saslauthd.conf.erb | 4 ++++ 2 files changed, 22 insertions(+) create mode 100644 sasl/templates/saslauthd.conf.erb diff --git a/sasl/manifests/init.pp b/sasl/manifests/init.pp index b8d60b6..f2c904a 100644 --- a/sasl/manifests/init.pp +++ b/sasl/manifests/init.pp @@ -28,6 +28,24 @@ class sasl::saslauthd { case $saslauthd_mech { "","pam": { } + "ldap": { + include ldap::client + + augeas { "set-saslauthd-mech": + context => "/files/etc/sysconfig/saslauthd", + changes => "set MECH ldap", + notify => Service["saslauthd"], + } + + file { "/etc/saslauthd.conf": + ensure => present, + mode => 0644, + owner => "root", + group => "root", + content => template("sasl/saslauthd.conf.erb"), + notify => Service["saslauthd"], + } + } "kerberos5": { augeas { "set-saslauthd-mech": context => "/files/etc/sysconfig/saslauthd", diff --git a/sasl/templates/saslauthd.conf.erb b/sasl/templates/saslauthd.conf.erb new file mode 100644 index 0000000..272bec7 --- /dev/null +++ b/sasl/templates/saslauthd.conf.erb @@ -0,0 +1,4 @@ +<% if has_variable=('saslauthd_mech') && saslauthd_mech == "ldap" -%> +ldap_servers: <% ldap_server.each do |uri| %><%= uri %> <% end %> +ldap_search_base: <%= ldap_basedn %> +<% end -%>