Gitlab LDAP Integration

0 comments
Gitlab : GitLab is a single application for the entire software development lifecycle. From project planning and source code management to CI/CD, monitoring, and security.
  • GitLab is the first single application built from the ground up for all stages of the DevOps lifecycle for Product, Development, QA, Security, and Operations teams to work concurrently on the same project. 
  • GitLab enables teams to collaborate and work from a single conversation, instead of managing multiple threads across disparate tools. 
  • GitLab provides teams a single data store, one user interface, and one permission model across the DevOps lifecycle allowing teams to collaborate, significantly reducing cycle time and focus exclusively on building great software quickly.
  • GitLab’s Kubernetes integration makes it easy to create and configure clusters. With Auto DevOps, GitLab automatically configures CI/CD pipelines to build, test, verify, and deploy applications to Kubernetes. 
HOST IP : 10.0.0.1 (VM On ESXi )
RAM : 4 Gb
HDD : 20 Gb
OS : Cent OS 7 64 Bit
Username : root
Standard User for WebGUI : root password : welcome

Installation of GITLAB on Centos 7 :

1. Install and configure the necessary dependencies:

On CentOS 7 (and RedHat/Oracle/Scientific Linux 7), the commands below will also    open HTTP and SSH access in the system firewall.
i)sudo yum install -y curl policycoreutils-python openssh-server
ii)sudo systemctl enable sshd
iii)sudo systemctl start sshd
iv)sudo firewall-cmd --permanent --add-service=http
v)sudo systemctl reload firewalld

Next, install Postfix to send notification emails. If you want to use another solution to send emails please skip this step and configure an external SMTP server after GitLab has been installed.
i)sudo yum install postfix
ii)sudo systemctl enable postfix
iii)sudo systemctl start postfix
         During Postfix installation a configuration screen may appear. Select 'Internet Site' and press enter. Use your server's external DNS for 'mail name' and press enter. If additional screens appear, continue to press enter to accept the defaults.

2. Add the GitLab package repository and install the package

Add the GitLab package repository.
curl https://packages.gitlab.com/install/repositories/gitlab/gitlab-ee/script.rpm.sh | sudo bash

Next, install the GitLab package. Change https://gitlab.example.com to the URL at which you want to access(http://gitlab.mumbai.cdac.in) your GitLab instance. Installation will automatically configure and start GitLab at that URL.

sudo EXTERNAL_URL="https://gitlab.example.com" yum install -y gitlab-ee

3. Browse to the hostname and login

         On your first visit, you'll be redirected to a password reset screen. Provide the password for the initial administrator account and you will be redirected back to the login screen. Use the default account's username root to login.



TO INTEGRATE GITLAB TO CDAC MUMBAI LDAP Use following settings :

  1. Create one user ‘gitlab’ with default password ‘Password@123’ for authentication with Active Directory .
  2. Edit file /etc/gitlab/gitlab.rb
  3. On line no 278 onwards add the following configuration in LDAP configuration :
    278 gitlab_rails['ldap_enabled'] = true
    279 gitlab_rails['ldap_servers'] = {
    280  'main' => {
    281                 'label' => 'MY LDAP',
    282                 'host' => '<insert your hostname of Domain controller >',
    283                 'port' => '389',
    284                 'uid' => 'sAMAccountName',
    285                 'encryption' => 'plain',
    286                 'verify_certificates' => 'false',
    287                 'bind_dn' => 'cn=gitlab,ou=ldap_test, DC = <domain name>, DC= com',
    288                 'password'=> 'Password@123',
    289                 'active_directory' => true,
    290                 'base' =>'ou=Staff,ou=User Accounts, dc=<domain name >,dc=com',
           291        'block_auto_created_users' => 'true',
    292                 'tls-ca-file' => "/home/certs/"
    293
    294           }
    295
    296 }

  1. Command to use after configurations
  • sudo  gitlab-ctl reconfigure
  • sudo service gitlab-runsvdir restart

  1. To check LDAP Configuration use command

gitlab-rake gitlab:ldap:check

  • After successful configuration you will be able to see your login by using CDACs webmail credentials


  • Reference : https://about.gitlab.com/

0 comments :

Post a Comment

Copyright 2014 http://techcontrolz.blogspot.in/ .
Blogger Template by Rohan Choudhari. . Creative Commons License