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 |
colin |
3357 |
$gitolite_hooksdir = "${gitolite_dir}/hooks" |
15 |
|
|
$gitolite_commonhooksdir = "${gitolite_hooksdir}/common" |
16 |
boklm |
3258 |
$gitolite_conf = "${gitolite_confdir}/gitolite.conf" |
17 |
|
|
$gitoliterc = "$git_homedir/.gitolite.rc" |
18 |
|
|
$bindpwfile = '/etc/mgagit.secret' |
19 |
boklm |
3277 |
$reposconf_dir = "${git_homedir}/repos-config" |
20 |
boklm |
3292 |
$vhostdir = "$git_homedir/www" |
21 |
boklm |
3258 |
|
22 |
colin |
3381 |
package { ['mgagit', 'gitolite', 'python-bugz']: |
23 |
boklm |
3258 |
ensure => installed, |
24 |
|
|
} |
25 |
|
|
|
26 |
|
|
group { $git_login: |
27 |
|
|
ensure => present, |
28 |
|
|
} |
29 |
|
|
user { $git_login: |
30 |
|
|
ensure => present, |
31 |
colin |
3330 |
comment => 'Mageia Git', |
32 |
boklm |
3258 |
home => $git_homedir, |
33 |
boklm |
3275 |
managehome => true, |
34 |
boklm |
3263 |
gid => $git_login, |
35 |
boklm |
3258 |
} |
36 |
|
|
|
37 |
|
|
file { '/etc/mgagit.conf': |
38 |
|
|
ensure => present, |
39 |
|
|
owner => root, |
40 |
|
|
group => root, |
41 |
|
|
mode => '0644', |
42 |
|
|
content => template('mgagit/mgagit.conf'), |
43 |
|
|
require => Package['mgagit'], |
44 |
|
|
} |
45 |
|
|
|
46 |
colin |
3358 |
file { "$gitolite_commonhooksdir/git_multimail.py": |
47 |
|
|
ensure => present, |
48 |
|
|
owner => $git_login, |
49 |
|
|
group => $git_login, |
50 |
|
|
mode => '0644', |
51 |
colin |
3356 |
content => template('mgagit/git_multimail.py'), |
52 |
colin |
3358 |
require => File[$gitolite_commonhooksdir], |
53 |
colin |
3356 |
} |
54 |
|
|
|
55 |
colin |
3358 |
file { "$gitolite_commonhooksdir/post-receive": |
56 |
|
|
ensure => present, |
57 |
|
|
owner => $git_login, |
58 |
|
|
group => $git_login, |
59 |
|
|
mode => '0755', |
60 |
colin |
3356 |
content => template('mgagit/git-post-receive-hook'), |
61 |
colin |
3358 |
require => File[$gitolite_commonhooksdir], |
62 |
colin |
3356 |
} |
63 |
|
|
|
64 |
colin |
3357 |
file { "$gitolite_commonhooksdir/post-update": |
65 |
|
|
ensure => present, |
66 |
|
|
owner => $git_login, |
67 |
|
|
group => $git_login, |
68 |
|
|
mode => '0755', |
69 |
|
|
content => template('mgagit/git-post-update-hook'), |
70 |
|
|
require => File[$gitolite_commonhooksdir], |
71 |
|
|
} |
72 |
|
|
|
73 |
colin |
3319 |
file { $gitolite_tmpldir: |
74 |
|
|
ensure => directory, |
75 |
|
|
owner => root, |
76 |
|
|
group => root, |
77 |
|
|
mode => '0755', |
78 |
|
|
} |
79 |
|
|
|
80 |
|
|
file { "$gitolite_tmpldir/group.gl": |
81 |
|
|
ensure => 'link', |
82 |
|
|
target => '/usr/share/mgagit/tmpl/group.gl', |
83 |
|
|
} |
84 |
|
|
|
85 |
|
|
file { "$gitolite_tmpldir/repodef_repo.gl": |
86 |
|
|
ensure => present, |
87 |
|
|
owner => root, |
88 |
|
|
group => root, |
89 |
|
|
mode => '0644', |
90 |
|
|
content => template('mgagit/repodef_repo.gl'), |
91 |
|
|
} |
92 |
|
|
|
93 |
colin |
3419 |
mgagit::tmpl { 'artwork': |
94 |
|
|
tmpldir => $gitolite_tmpldir, |
95 |
|
|
ml => 'atelier', |
96 |
|
|
} |
97 |
|
|
|
98 |
|
|
mgagit::tmpl { 'doc': |
99 |
|
|
tmpldir => $gitolite_tmpldir, |
100 |
|
|
ml => 'atelier', # NB This is wrong, we should have a doc-commits@ ML (and thus remove this line) |
101 |
|
|
} |
102 |
|
|
|
103 |
colin |
3483 |
mgagit::tmpl { 'infrastructure': |
104 |
|
|
tmpldir => $gitolite_tmpldir, |
105 |
|
|
group => 'sysadmin', |
106 |
|
|
ml => 'sysadmin', |
107 |
|
|
} |
108 |
|
|
|
109 |
colin |
3476 |
mgagit::tmpl { 'org': |
110 |
|
|
tmpldir => $gitolite_tmpldir, |
111 |
colin |
3477 |
group => 'board', |
112 |
colin |
3482 |
ml => 'board', |
113 |
colin |
3476 |
} |
114 |
|
|
|
115 |
colin |
3419 |
mgagit::tmpl { 'qa': |
116 |
|
|
tmpldir => $gitolite_tmpldir, |
117 |
|
|
} |
118 |
|
|
|
119 |
colin |
3321 |
mgagit::tmpl { 'soft': |
120 |
colin |
3322 |
tmpldir => $gitolite_tmpldir, |
121 |
colin |
3325 |
group => 'packagers-committers', |
122 |
colin |
3319 |
} |
123 |
|
|
|
124 |
colin |
3321 |
mgagit::tmpl { 'web': |
125 |
colin |
3322 |
tmpldir => $gitolite_tmpldir, |
126 |
colin |
3320 |
ml => 'atelier', |
127 |
colin |
3319 |
} |
128 |
|
|
|
129 |
boklm |
3292 |
file { [$gitolite_dir, $gitolite_keydir, $gitolite_confdir, |
130 |
colin |
3357 |
$gitolite_hooksdir, $gitolite_commonhooksdir, |
131 |
boklm |
3292 |
$reposconf_dir, $vhostdir]: |
132 |
boklm |
3258 |
ensure => directory, |
133 |
|
|
owner => $git_login, |
134 |
|
|
group => $git_login, |
135 |
|
|
mode => '0755', |
136 |
|
|
} |
137 |
|
|
|
138 |
|
|
file { $gitoliterc: |
139 |
|
|
ensure => present, |
140 |
|
|
owner => $git_login, |
141 |
|
|
group => $git_login, |
142 |
|
|
mode => '0644', |
143 |
|
|
content => template('mgagit/gitolite.rc'), |
144 |
|
|
} |
145 |
|
|
|
146 |
|
|
file { $bindpwfile: |
147 |
|
|
ensure => present, |
148 |
|
|
owner => $git_login, |
149 |
|
|
group => $git_login, |
150 |
|
|
mode => '0600', |
151 |
|
|
content => inline_template('<%= @bindpw %>'), |
152 |
|
|
} |
153 |
boklm |
3267 |
|
154 |
|
|
file { $git_dir: |
155 |
|
|
ensure => directory, |
156 |
|
|
owner => $git_login, |
157 |
|
|
group => $git_login, |
158 |
|
|
mode => '0755', |
159 |
|
|
} |
160 |
|
|
|
161 |
|
|
file { "$git_homedir/repositories": |
162 |
|
|
ensure => 'link', |
163 |
|
|
target => $git_dir, |
164 |
|
|
} |
165 |
boklm |
3292 |
|
166 |
|
|
apache::vhost::base { $vhost: |
167 |
|
|
location => $vhostdir, |
168 |
boklm |
3293 |
} |
169 |
boklm |
3258 |
} |
170 |
|
|
# vim: sw=2 |