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

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

{% if uri is defined %}
# The location at which the LDAP server(s) should be reachable.
uri 	{{ uri }}
{% endif %}
{% if basedn is defined %}
# The search base that will be used for all queries.
base {{ basedn }}
{% endif %}

# The LDAP protocol version to use.
#ldap_version 3

# The DN to bind with for normal lookups.
#binddn cn=annonymous,dc=example,dc=net
#bindpw secret

# The DN used for password modifications by root.
rootpwmoddn cn=admin,{{ basedn }}

{% if ssl is defined and uri != "ldap://127.0.0.1" %}
# adding SSL options for openssl CA 
tls_reqcert never
tls_cacertfile {{ldap_cert_dir}}/{{ca_domain}}-cacert.pem
{% else %}
# SSL options
#ssl off
#tls_reqcert never
tls_cacertfile /etc/ssl/certs/ca-certificates.crt
{% endif %}

# The search scope.
#scope sub

{% if ldap_filter is defined and ldap_filter | length > 0 %}
# adding user filtering
filter passwd {{ ldap_filter }}
filter shadow {{ ldap_filter }}
{% endif %}
{% if ldap_gfilter is defined and ldap_gfilter | length > 0 %}
# adding group filtering
filter group {{ ldap_gfilter }}
{% endif %}


