Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

Commit 105d247

Browse files
committed
Use New ldap configuration method
1 parent e1a13cd commit 105d247

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ GitLab LetsEncrypt configuration; tells GitLab whether to request and use a cert
8181
gitlab_ldap_password: "password"
8282
gitlab_ldap_base: "DC=example,DC=com"
8383

84-
GitLab LDAP configuration; if `gitlab_ldap_enabled` is `true`, the rest of the configuration will tell GitLab how to connect to an LDAP server for centralized authentication.
84+
GitLab LDAP configuration; if `gitlab_ldap_enabled` is `true`, the rest of the configuration will tell GitLab how to connect to an LDAP server for centralized authentication. gitlab_ldap_method is one of 'start_tls', 'simple_tls', or 'plain' (usually, you want simple_tls): see https://docs.gitlab.com/ee/administration/auth/ldap/ for full gitlab documentation.
8585

8686
gitlab_dependencies:
8787
- openssh-server

templates/gitlab.rb.j2

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,19 @@ gitlab_rails['backup_path'] = "{{ gitlab_backup_path }}"
3838
# https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/gitlab.yml.example#L118
3939
gitlab_rails['ldap_enabled'] = {{ gitlab_ldap_enabled | lower }}
4040
{% if gitlab_ldap_enabled %}
41-
gitlab_rails['ldap_host'] = '{{ gitlab_ldap_host }}'
42-
gitlab_rails['ldap_port'] = {{ gitlab_ldap_port }}
43-
gitlab_rails['ldap_uid'] = '{{ gitlab_ldap_uid }}'
44-
gitlab_rails['ldap_method'] = '{{ gitlab_ldap_method}}' # 'ssl' or 'plain'
45-
gitlab_rails['ldap_bind_dn'] = '{{ gitlab_ldap_bind_dn }}'
46-
gitlab_rails['ldap_password'] = '{{ gitlab_ldap_password }}'
47-
gitlab_rails['ldap_allow_username_or_email_login'] = true
48-
gitlab_rails['ldap_base'] = '{{ gitlab_ldap_base }}'
41+
gitlab_rails['ldap_servers'] = {
42+
'main' => {
43+
'label' => 'LDAP',
44+
'host' => '{{ gitlab_ldap_host }}',
45+
'port' => {{ gitlab_ldap_port }},
46+
'uid' => '{{ gitlab_ldap_uid }}',
47+
'encryption' => '{{ gitlab_ldap_method}}',
48+
'bind_dn' => '{{ gitlab_ldap_bind_dn }}',
49+
'password' => '{{ gitlab_ldap_password }}',
50+
'allow_username_or_email_login' => true,
51+
'base' => '{{ gitlab_ldap_base }}'
52+
}
53+
}
4954
{% endif %}
5055

5156
# GitLab Nginx

0 commit comments

Comments
 (0)