Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use different Base DN for LDAP group search #174

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,15 @@ openvpn_use_pam_users: []

# LDAP authentication and configuration (optional)
openvpn_use_ldap: false
openvpn_ldap_server: # ldapserver.example.org or ldap://ldapserver.example.org
openvpn_ldap_tlsenable: 'false'
openvpn_ldap_follow_referrals: 'false'
openvpn_ldap_bind_dn: # cn=administrator,cn=users,dc=ctc,dc=local
openvpn_ldap_bind_password:
openvpn_ldap_base_dn: # dc=ctc,dc=local
openvpn_ldap_search_filter: # sAMAccountName=%u
openvpn_ldap_group_base_dn: # ou=groups,dc=ctc,dc=local if empty fallback to openvpn_ldap_base_dn
openvpn_ldap_group_search_filter: # cn=OpenVPNUsers

# Use simple authentication (default is disabled)
openvpn_simple_auth: false
Expand Down
4 changes: 3 additions & 1 deletion templates/authentication/auth-ldap.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@
# e.g. "sAMAccountName=%u"
SearchFilter {{ openvpn_ldap_search_filter }}
RequireGroup true
{% if openvpn_ldap_group_search_filter %}
<Group>
BaseDN {{ openvpn_ldap_base_dn }}
BaseDN {{ openvpn_ldap_group_base_dn | default(openvpn_ldap_base_dn) }}
# e.g. "cn=OpenVPNUsers"
SearchFilter {{ openvpn_ldap_group_search_filter }}
MemberAttribute Member
</Group>
{% endif %}
</Authorization>