ldap: Converted nslcd.conf to template and added support for active directory attribute mappings.

This commit is contained in:
Timo Makinen 2014-01-21 13:18:56 +02:00
parent d0a5bca536
commit 9a1964c71a
2 changed files with 55 additions and 32 deletions

View file

@ -0,0 +1,34 @@
uid nslcd
<% if @operatingsystem == "Ubuntu" -%>
gid nslcd
<% else -%>
gid ldap
<% end -%>
uri <%= @ldap_uri %>
base <%= @ldap_basedn %>
<% if ['ad','activedirectory'].index(@mapping) -%>
pagesize 1000
filter passwd (&(objectClass=user)(!(objectClass=computer))(uidNumber=*))
map passwd uid sAMAccountName
map passwd gecos displayName
map passwd loginShell "${loginShell:-/bin/bash}"
map passwd homeDirectory "${unixHomeDirectory:-/home/$sAMAccountName}"
filter group (&(objectClass=group)(gidNumber=*))
<% if @operatingsystem == "CentOS" -%>
map group uniqueMember member
<% end -%>
<% else -%>
pagesize 500
<% if @operatingsystem != "CentOS" -%>
map group member uniqueMember
<% end -%>
<% end -%>
<% if @ldap_uri =~ /^ldaps:/ -%>
ssl on
tls_reqcert never
<% else -%>
ssl off
<% end -%>