1 |
boklm |
3258 |
class mgagit( |
2 |
boklm |
3267 |
$git_dir = '/git', |
3 |
boklm |
3258 |
$ldap_server = 'ldap.mageia.org', |
4 |
|
|
$binddn = 'uid=mgagit,ou=People,dc=mageia,dc=org', |
5 |
boklm |
3292 |
$vhost = 'projects.mageia.org', |
6 |
boklm |
3258 |
$bindpw |
7 |
|
|
){ |
8 |
|
|
$git_login = 'git' |
9 |
|
|
$git_homedir = "/var/lib/${git_login}" |
10 |
|
|
$gitolite_dir = "${git_homedir}/.gitolite" |
11 |
|
|
$gitolite_keydir = "${gitolite_dir}/keydir" |
12 |
colin |
3319 |
$gitolite_tmpldir = "/etc/mgagit/tmpl" |
13 |
boklm |
3258 |
$gitolite_confdir = "${gitolite_dir}/conf" |
14 |
|
|
$gitolite_conf = "${gitolite_confdir}/gitolite.conf" |
15 |
|
|
$gitoliterc = "$git_homedir/.gitolite.rc" |
16 |
|
|
$bindpwfile = '/etc/mgagit.secret' |
17 |
boklm |
3277 |
$reposconf_dir = "${git_homedir}/repos-config" |
18 |
boklm |
3292 |
$vhostdir = "$git_homedir/www" |
19 |
boklm |
3258 |
|
20 |
|
|
package { ['mgagit', 'gitolite']: |
21 |
|
|
ensure => installed, |
22 |
|
|
} |
23 |
|
|
|
24 |
|
|
group { $git_login: |
25 |
|
|
ensure => present, |
26 |
|
|
} |
27 |
|
|
user { $git_login: |
28 |
|
|
ensure => present, |
29 |
|
|
comment => 'Git user', |
30 |
|
|
home => $git_homedir, |
31 |
boklm |
3275 |
managehome => true, |
32 |
boklm |
3263 |
gid => $git_login, |
33 |
boklm |
3258 |
} |
34 |
|
|
|
35 |
|
|
file { '/etc/mgagit.conf': |
36 |
|
|
ensure => present, |
37 |
|
|
owner => root, |
38 |
|
|
group => root, |
39 |
|
|
mode => '0644', |
40 |
|
|
content => template('mgagit/mgagit.conf'), |
41 |
|
|
require => Package['mgagit'], |
42 |
|
|
} |
43 |
|
|
|
44 |
colin |
3319 |
file { $gitolite_tmpldir: |
45 |
|
|
ensure => directory, |
46 |
|
|
owner => root, |
47 |
|
|
group => root, |
48 |
|
|
mode => '0755', |
49 |
|
|
} |
50 |
|
|
|
51 |
|
|
file { "$gitolite_tmpldir/group.gl": |
52 |
|
|
ensure => 'link', |
53 |
|
|
target => '/usr/share/mgagit/tmpl/group.gl', |
54 |
|
|
} |
55 |
|
|
|
56 |
|
|
file { "$gitolite_tmpldir/repodef_repo.gl": |
57 |
|
|
ensure => present, |
58 |
|
|
owner => root, |
59 |
|
|
group => root, |
60 |
|
|
mode => '0644', |
61 |
|
|
content => template('mgagit/repodef_repo.gl'), |
62 |
|
|
} |
63 |
|
|
|
64 |
colin |
3320 |
define mgagit::tmpl { 'soft': |
65 |
|
|
tmpdir => $gitolite_tmpldir, |
66 |
|
|
group => 'packages', |
67 |
colin |
3319 |
} |
68 |
|
|
|
69 |
colin |
3320 |
define mgagit::tmpl { 'web': |
70 |
|
|
tmpdir => $gitolite_tmpldir, |
71 |
|
|
ml => 'atelier', |
72 |
colin |
3319 |
} |
73 |
|
|
|
74 |
boklm |
3292 |
file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir, |
75 |
|
|
$reposconf_dir, $vhostdir]: |
76 |
boklm |
3258 |
ensure => directory, |
77 |
|
|
owner => $git_login, |
78 |
|
|
group => $git_login, |
79 |
|
|
mode => '0755', |
80 |
|
|
} |
81 |
|
|
|
82 |
|
|
file { $gitoliterc: |
83 |
|
|
ensure => present, |
84 |
|
|
owner => $git_login, |
85 |
|
|
group => $git_login, |
86 |
|
|
mode => '0644', |
87 |
|
|
content => template('mgagit/gitolite.rc'), |
88 |
|
|
} |
89 |
|
|
|
90 |
|
|
file { $bindpwfile: |
91 |
|
|
ensure => present, |
92 |
|
|
owner => $git_login, |
93 |
|
|
group => $git_login, |
94 |
|
|
mode => '0600', |
95 |
|
|
content => inline_template('<%= @bindpw %>'), |
96 |
|
|
} |
97 |
boklm |
3267 |
|
98 |
|
|
file { $git_dir: |
99 |
|
|
ensure => directory, |
100 |
|
|
owner => $git_login, |
101 |
|
|
group => $git_login, |
102 |
|
|
mode => '0755', |
103 |
|
|
} |
104 |
|
|
|
105 |
|
|
file { "$git_homedir/repositories": |
106 |
|
|
ensure => 'link', |
107 |
|
|
target => $git_dir, |
108 |
|
|
} |
109 |
boklm |
3292 |
|
110 |
|
|
apache::vhost::base { $vhost: |
111 |
|
|
location => $vhostdir, |
112 |
boklm |
3293 |
} |
113 |
boklm |
3258 |
} |
114 |
|
|
# vim: sw=2 |