1 |
boklm |
3258 |
class mgagit( |
2 |
|
|
$ldap_server = 'ldap.mageia.org', |
3 |
|
|
$binddn = 'uid=mgagit,ou=People,dc=mageia,dc=org', |
4 |
|
|
$bindpw |
5 |
|
|
){ |
6 |
|
|
$git_login = 'git' |
7 |
|
|
$git_homedir = "/var/lib/${git_login}" |
8 |
|
|
$gitolite_dir = "${git_homedir}/.gitolite" |
9 |
|
|
$gitolite_keydir = "${gitolite_dir}/keydir" |
10 |
|
|
$gitolite_confdir = "${gitolite_dir}/conf" |
11 |
|
|
$gitolite_conf = "${gitolite_confdir}/gitolite.conf" |
12 |
|
|
$gitoliterc = "$git_homedir/.gitolite.rc" |
13 |
|
|
$bindpwfile = '/etc/mgagit.secret' |
14 |
|
|
|
15 |
|
|
package { ['mgagit', 'gitolite']: |
16 |
|
|
ensure => installed, |
17 |
|
|
} |
18 |
|
|
|
19 |
|
|
group { $git_login: |
20 |
|
|
ensure => present, |
21 |
|
|
} |
22 |
|
|
user { $git_login: |
23 |
|
|
ensure => present, |
24 |
|
|
comment => 'Git user', |
25 |
|
|
home => $git_homedir, |
26 |
boklm |
3264 |
managehome => true, |
27 |
boklm |
3263 |
gid => $git_login, |
28 |
boklm |
3258 |
} |
29 |
|
|
|
30 |
|
|
file { '/etc/mgagit.conf': |
31 |
|
|
ensure => present, |
32 |
|
|
owner => root, |
33 |
|
|
group => root, |
34 |
|
|
mode => '0644', |
35 |
|
|
content => template('mgagit/mgagit.conf'), |
36 |
|
|
require => Package['mgagit'], |
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir]: |
40 |
|
|
ensure => directory, |
41 |
|
|
owner => $git_login, |
42 |
|
|
group => $git_login, |
43 |
|
|
mode => '0755', |
44 |
|
|
} |
45 |
|
|
|
46 |
|
|
file { $gitoliterc: |
47 |
|
|
ensure => present, |
48 |
|
|
owner => $git_login, |
49 |
|
|
group => $git_login, |
50 |
|
|
mode => '0644', |
51 |
|
|
content => template('mgagit/gitolite.rc'), |
52 |
|
|
} |
53 |
|
|
|
54 |
|
|
file { $bindpwfile: |
55 |
|
|
ensure => present, |
56 |
|
|
owner => $git_login, |
57 |
|
|
group => $git_login, |
58 |
|
|
mode => '0600', |
59 |
|
|
content => inline_template('<%= @bindpw %>'), |
60 |
|
|
} |
61 |
|
|
} |
62 |
|
|
# vim: sw=2 |