Puppet Class: gitlab::ci::setup
- Inherits:
- gitlab::ci
- Defined in:
- manifests/ci/setup.pp
Overview
- Class
-
gitlab::ci::setup
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'manifests/ci/setup.pp', line 4
class gitlab::ci::setup inherits gitlab::ci {
include ::git
File {
owner => $ci_user,
group => $ci_user,
}
# user
user { $ci_user:
ensure => present,
shell => '/bin/bash',
password => '*',
home => $ci_home,
comment => $ci_comment,
system => true,
managehome => true,
}
# database dependencies
case $::osfamily {
'Debian': {
case $gitlab_dbtype {
'mysql': {
ensure_packages(['libmysql++-dev','libmysqlclient-dev'])
}
'pgsql': {
ensure_packages(['libpq-dev','postgresql-client'])
}
default: {
fail("unknow dbtype (${gitlab_dbtype})")
}
}
}
'RedHat': {
case $gitlab_dbtype {
'mysql': {
ensure_packages(['mysql-devel'])
}
'pgsql': {
ensure_packages(['postgresql-devel'])
}
default: {
fail("unknow dbtype (${gitlab_dbtype})")
}
}
}
default: {
fail("${::osfamily} not supported yet")
}
} # Case $::osfamily
# By default, puppet-rbenv sets ~/.profile to load rbenv, which is
# read when bash is invoked as an interactive login shell, but we
# also need ~/.bashrc to load rbenv (which is read by interactive
# but non-login shells). This works, but may not be the best
# solution, please see issue #114 if you have a better solution.
file { "${ci_home}/.bashrc":
ensure => file,
content => "source ${ci_home}/.rbenvrc",
require => Rbenv::Install[$ci_user],
}
rbenv::install { $ci_user:
group => $ci_user,
home => $ci_home,
require => User[$ci_user],
}
rbenv::compile { 'gitlabci/ruby':
user => $ci_user,
home => $ci_home,
ruby => $gitlab_ruby_version,
global => true,
notify => Exec['install gitlab-ci'],
}
}
|