FreeIPA 和 Gitlab 的搭建,可以参考我之前的博客。

FreeIPA域名 server.zhuxu.co(内部测试,修改一下gitlab的host文件 ip FreeIPA域名 )

vim  /etc/gitlab/gitlab.rb
gitlab_rails['ldap_enabled'] = true
gitlab_rails['ldap_servers'] = YAML.load <<-'EOS'
   main: # 'main' is the GitLab 'provider ID' of this LDAP server
     label: 'LDAP'
     host: '192.168.100.23'
     port: 389
     uid: 'uid'
     bind_dn: 'uid=admin,cn=users,cn=accounts,dc=zhuxu,dc=co'
     password: '123456'
     encryption: 'plain' # "start_tls" or "simple_tls" or "plain"
     verify_certificates: true
     active_directory: true
     allow_username_or_email_login: true
     lowercase_usernames: false
     block_auto_created_users: false
     base: 'dc=zhuxu,dc=co'
     user_filter: ''
     attributes:
       username: ['uid', 'userid', 'sAMAccountName']
       email:    ['mail', 'email', 'userPrincipalName']
       name:       'cn'
       first_name: 'givenName'
       last_name:  'sn'
     admin_group: 'cn=admins'
     sync_ssh_keys: true
EOS
gitlab-ctl reconfigure
gitlab-ctl restart