Skip to content

Instantly share code, notes, and snippets.

@janschumann
Created February 6, 2015 14:47
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save janschumann/e9bb6a0298101a465d94 to your computer and use it in GitHub Desktop.
Save janschumann/e9bb6a0298101a465d94 to your computer and use it in GitHub Desktop.
Install omniout_crowd with gitlab via puppet
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'] ]
}
@tthayer
Copy link

tthayer commented Mar 27, 2015

This was hugely helpful. Thanks for putting this out there.

@tthayer
Copy link

tthayer commented May 18, 2015

One thing to note:
Line 10 doesn't work for me until I change it to this:

    match   => "^.*provider_arguments << provider\[\'args\'\]",

@hudecof
Copy link

hudecof commented Jul 1, 2015

please update the gem version to 2.2.3. For the new installation 7.11 and newer the 2.2.2 will not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment