From 42a7b8a82b125ebd4f3ac1889de3659855376dc6 Mon Sep 17 00:00:00 2001 From: Ben Langfeld Date: Wed, 30 Apr 2014 16:52:48 -0300 Subject: [PATCH] Allow enabling the password policy overlay --- README.md | 10 ++++++++++ manifests/server/master.pp | 12 +++++++++++- templates/etc/openldap/slapd.conf.erb | 10 ++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b2de422..28e2aff 100644 --- a/README.md +++ b/README.md @@ -89,6 +89,16 @@ With TLS/SSL enabled: *NOTE*: SSL certificates should reside in you puppet master file repository 'puppet:///files/ldap/' +With password policies enabled: + + class { 'ldap::server::master': + suffix => 'dc=foo,dc=bar', + rootpw => '{SHA}iEPX+SQWIR3p67lj/0zigSWTKHg=', + ppolicy => true, + ppolicy_default => 'cn=default,ou=policies,dc=foo,dc=bar', + modules_inc => [ 'ppolicy' ], + } + #### Slave server #### Configure an OpenLdap slave: diff --git a/manifests/server/master.pp b/manifests/server/master.pp index 82c5565..c82231f 100644 --- a/manifests/server/master.pp +++ b/manifests/server/master.pp @@ -76,6 +76,14 @@ # # *Optional* (defaults to *'false'*) # +# [ppolicy] +# +# *Optional* (defaults to *'false'*) +# +# [policy_default] +# +# *Optional* (defaults to *'nil'*) +# # [enable_motd] # Use motd to report the usage of this module. # *Requires*: https://github.com/torian/puppet-motd.git @@ -137,6 +145,8 @@ $syncprov_checkpoint = '100 10', $syncprov_sessionlog = '100', $sync_binddn = false, + $ppolicy = false, + $ppolicy_default = nil, $enable_motd = false, $ensure = present) { @@ -245,7 +255,7 @@ # Additional configurations (for rc scripts) case $::osfamily { - + 'Debian' : { class { 'ldap::server::debian': ssl => $ssl } } diff --git a/templates/etc/openldap/slapd.conf.erb b/templates/etc/openldap/slapd.conf.erb index 939ea2e..353718d 100644 --- a/templates/etc/openldap/slapd.conf.erb +++ b/templates/etc/openldap/slapd.conf.erb @@ -81,6 +81,16 @@ updateref <%= @sync_provider %> ####################################################################### +####################################################################### +# << PPolicy + +<% if has_variable?('ppolicy') and @ppolicy == true then -%> +overlay ppolicy +ppolicy_default "<%= @ppolicy_default %>" +<% end -%> + +####################################################################### + checkpoint 512 30 dbconfig set_cachesize 0 2097152 0 dbconfig set_lk_max_objects 1500