13 May 2015

README FIRST

If you are using version before 6.6 read older post.

If you are using version 6.6 and newer, should be working also for 7.X read older post.


Overview

Please read the previous posts, at least the second one.

Meanwhile I migrated to the omnibus package, so this posts is about the omnibus package.

Installation and configuration

This section is out of th scope, please follow the documentation related to the Crowd and Gitlab omnibus version.

Patch Gitlab

In the original issue ticket https://github.com/gitlabhq/gitlabhq/issues/1240 janschumann added link to the Gist

file_line { 'omniauth_crowd-gem':
  path    => '/opt/gitlab/embedded/service/gitlab-rails/Gemfile',
  line    => 'gem "omniauth_crowd", "2.2.2"',
  require => Package['gitlab']
}

file_line { 'patch-devise-rb':
  path    => '/opt/gitlab/embedded/service/gitlab-rails/config/initializers/devise.rb',
  line    => "      provider_arguments << provider['args'].symbolize_keys",
  match   => "^      provider_arguments << provider\\['args'\\]\$",
  require => Package['gitlab']
}

exec { "install-omniouth-crowd-gem":
  unless  => '/bin/sh -c "test -d /opt/gitlab/embedded/service/gem/ruby/2.1.0/gems/omniauth_crowd-2.2.2"',
  cwd     => '/opt/gitlab/embedded/service/gitlab-rails',
  command => '/opt/gitlab/embedded/bin/bundle install',
  require => [ File_Line['omniauth_crowd-gem'], File_Line['patch-devise-rb'] ],
  before  => [ Exec['/usr/bin/gitlab-ctl reconfigure'], Exec['start gitlab'] ]
}