Puppet module for manage GitLab installation
Ruby Puppet HTML Other
Latest commit 654a3ff Sep 20, 2015 @sbadia Merge pull request #233 from gcmalloc/master
gitlab OAuth2

README.md

Puppet-gitlab

Build Status Puppet Forge License

Table of contents

  1. Overview
  2. Module description
  3. Parameters
  4. Usage
  5. Limitation
  6. Development

Overview

GitLab is a free project and repository management application

A Puppet Module is a collection of related content that can be used to model the configuration of a discrete service.

Module description

This module is based on the admin guides for gitlab, stable version.

Dependencies

See gitlab example.

GitLab web interface

  1. Add an ssh key to your account, or create another account
  2. Create a project
  3. Play !

Parameters

See manifest/init.pp and manifests/params.pp

Usage

Note: Assume that a database server is already installed on your server/infrastructure (see: vagrant-gitlab).

class gitlab

class {
  'gitlab':
    git_email         => 'notifs@foobar.fr',
    git_comment       => 'GitLab',
    gitlab_domain     => 'gitlab.foobar.fr',
    gitlab_dbtype     => 'mysql',
    gitlab_dbname     => $gitlab_dbname,
    gitlab_dbuser     => $gitlab_dbuser,
    gitlab_dbpwd      => $gitlab_dbpwd,
    ldap_enabled      => false,
}

class gitlab::ci

class { 'gitlab::ci':
  ci_comment         => 'GitLab',
  gitlab_server_urls => ['https://gitlab.example.org']
  gitlab_domain      => $gitlab_domain,
  gitlab_dbtype      => 'mysql',
  gitlab_dbname      => $ci_dbname,
  gitlab_dbuser      => $ci_dbuser,
  gitlab_dbpwd       => $ci_dbpwd,
  gitlab_http_port   => 8081,
}

class gitlab::ci::runner

# The registration token can be found at: http://ci.example.com/admin/runners, accessible through Header > Runners.
class { 'gitlab::ci::runner':
  ci_server_url      => 'https://ci.example.com',
  registration_token => 'replaceme',
}

A Complete example

include redis
include nginx
include mysql::server
include git
include nodejs
include logrotate

mysql::db {'gitlab': user => 'user', password => 'password' }

class {'gitlab':
  git_user                 => 'git',
  git_home                 => '/home/git',
  git_email                => 'gitlab@fooboozoo.fr',
  git_comment              => 'GitLab',
  gitlab_sources           => 'https://github.com/gitlabhq/gitlabhq.git',
  gitlab_domain            => 'gitlab.localdomain.local',
  gitlab_http_timeout      => '300',
  gitlab_dbtype            => 'mysql',
  gitlab_backup            => true,
  gitlab_dbname            => 'gitlab',
  gitlab_dbuser            => 'user',
  gitlab_dbpwd             => 'password',
  ldap_enabled             => false,
}

Limitations

This module has been built on and tested against Puppet 2.7 and higher.

The module has been tested on:

  • RedHat Enterprise Linux 5/6/7
  • Debian 6/7
  • CentOS 5/6/7
  • Ubuntu 12.04/14.04

Testing on other platforms has been light and cannot be guaranteed.

Development

Want to help - send a pull request.

Beaker-Rspec

This module has beaker-rspec tests

To run:

bundle install
bundle exec rspec spec/acceptance
# or use BEAKER_destroy=no to keep the resulting vm
BEAKER_destroy=no bundle exec rspec spec/acceptance
# or for centos
BEAKER_set=centos-70-x64 BEAKER_destroy=no bundle exec rspec spec/acceptance

Development environment with vagrant

See vagrant-gitlab.