# /etc/nslcd.conf
# nslcd configuration file. See nslcd.conf(5)
# for details.

# This is the number of threads that are started to wait for requests.
threads 5

# The user and group nslcd should run as.
uid nslcd
gid ldap

# The location at which the LDAP server(s) should be reachable.
uri <%= @ad_protocol %>://<%= @ad_server %>:<%= @ad_port %>/

# The search base that will be used for all queries.
base <%= @ad_search_base %>

# The DN to bind with for normal lookups.
binddn <%= @ad_bind_dn %>
bindpw <%= @ad_bind_password %>

# The search scope.
scope sub

filter passwd (&(objectClass=user)<% node['nginx']['allow_groups'].each do |group| -%>(memberOf=<%= group %>)<% end %>)
filter shadow (objectClass=user)

map     passwd  uid     sAMAccountName
map     shadow  uid     sAMAccountName

