1 |
misc |
213 |
class buildsystem { |
2 |
dmorgan |
86 |
|
3 |
boklm |
356 |
class base { |
4 |
|
|
$build_login = "iurt" |
5 |
blino |
387 |
$build_home_dir = "/home/$build_login" |
6 |
blino |
397 |
$sched_login = "schedbot" |
7 |
blino |
393 |
$sched_home_dir = "/home/$sched_login" |
8 |
blino |
545 |
$repository_root = "/distrib/bootstrap" |
9 |
blino |
366 |
|
10 |
|
|
include ssh::auth |
11 |
|
|
ssh::auth::key { $build_login: } # declare a key for build bot: RSA, 2048 bits |
12 |
blino |
395 |
ssh::auth::key { $sched_login: } # declare a key for sched bot: RSA, 2048 bits |
13 |
boklm |
356 |
} |
14 |
boklm |
355 |
|
15 |
boklm |
356 |
class mainnode inherits base { |
16 |
blino |
381 |
include iurtuser |
17 |
blino |
353 |
|
18 |
blino |
395 |
sshuser { $sched_login: |
19 |
|
|
homedir => $sched_home_dir, |
20 |
|
|
comment => "System user used to schedule builds", |
21 |
|
|
} |
22 |
|
|
|
23 |
blino |
399 |
ssh::auth::client { $sched_login: } |
24 |
blino |
573 |
ssh::auth::server { $sched_login: } |
25 |
blino |
399 |
ssh::auth::server { $build_login: } |
26 |
|
|
|
27 |
blino |
398 |
$package_list = ['task-bs-cluster-main', 'iurt'] |
28 |
|
|
package { $package_list: |
29 |
blino |
350 |
ensure => "installed" |
30 |
|
|
} |
31 |
blino |
403 |
|
32 |
|
|
apache::vhost_other_app { "repository.$domain": |
33 |
blino |
404 |
vhost_file => "buildsystem/vhost_repository.conf", |
34 |
blino |
403 |
} |
35 |
|
|
|
36 |
blino |
466 |
apache::vhost_other_app { "pkgsubmit.$domain": |
37 |
|
|
vhost_file => "buildsystem/vhost_pkgsubmit.conf", |
38 |
|
|
} |
39 |
|
|
|
40 |
blino |
430 |
include scheduler |
41 |
blino |
431 |
include gatherer |
42 |
blino |
500 |
include repsys |
43 |
blino |
517 |
include youri_submit |
44 |
blino |
350 |
} |
45 |
|
|
|
46 |
boklm |
356 |
class buildnode inherits base { |
47 |
misc |
213 |
include iurt |
48 |
dmorgan |
86 |
} |
49 |
|
|
|
50 |
misc |
265 |
class scheduler { |
51 |
|
|
# ulri |
52 |
blino |
430 |
include iurtupload |
53 |
misc |
265 |
} |
54 |
|
|
|
55 |
blino |
431 |
class gatherer { |
56 |
misc |
265 |
# emi |
57 |
blino |
430 |
include iurtupload |
58 |
misc |
265 |
} |
59 |
blino |
430 |
|
60 |
|
|
class iurtupload { |
61 |
blino |
432 |
file { "/etc/iurt/upload.conf": |
62 |
blino |
430 |
ensure => present, |
63 |
|
|
owner => $build_login, |
64 |
|
|
group => $build_login, |
65 |
|
|
mode => 644, |
66 |
|
|
require => File["/etc/iurt"], |
67 |
|
|
content => template("buildsystem/upload.conf") |
68 |
|
|
} |
69 |
|
|
} |
70 |
misc |
265 |
|
71 |
|
|
class repsys { |
72 |
|
|
package { 'repsys': |
73 |
|
|
|
74 |
|
|
} |
75 |
|
|
|
76 |
blino |
505 |
package { 'rpm-build': |
77 |
|
|
} |
78 |
|
|
|
79 |
blino |
500 |
file { "repsys.conf": |
80 |
|
|
path => "/etc/repsys.conf", |
81 |
|
|
owner => root, |
82 |
|
|
group => root, |
83 |
|
|
mode => 644, |
84 |
|
|
content => template("buildsystem/repsys.conf") |
85 |
|
|
} |
86 |
blino |
502 |
|
87 |
|
|
file { "$sched_home_dir/repsys": |
88 |
|
|
ensure => "directory", |
89 |
blino |
508 |
owner => $sched_login, |
90 |
blino |
502 |
require => File[$sched_home_dir], |
91 |
|
|
} |
92 |
|
|
|
93 |
|
|
file { "$sched_home_dir/repsys/tmp": |
94 |
|
|
ensure => "directory", |
95 |
blino |
508 |
owner => $sched_login, |
96 |
boklm |
512 |
group => "mga-packagers", |
97 |
boklm |
510 |
mode => 1775, |
98 |
blino |
502 |
require => File["$sched_home_dir/repsys"], |
99 |
|
|
} |
100 |
|
|
|
101 |
|
|
file { "$sched_home_dir/repsys/srpms": |
102 |
|
|
ensure => "directory", |
103 |
blino |
508 |
owner => $sched_login, |
104 |
boklm |
512 |
group => "mga-packagers", |
105 |
boklm |
510 |
mode => 1775, |
106 |
blino |
502 |
require => File["$sched_home_dir/repsys"], |
107 |
|
|
} |
108 |
misc |
265 |
} |
109 |
|
|
|
110 |
blino |
516 |
class youri_submit { |
111 |
boklm |
522 |
include sudo |
112 |
|
|
|
113 |
blino |
516 |
file { "/usr/local/bin/mdv-youri-submit": |
114 |
|
|
owner => root, |
115 |
|
|
group => root, |
116 |
|
|
mode => 755, |
117 |
|
|
content => template("buildsystem/mdv-youri-submit") |
118 |
|
|
} |
119 |
|
|
|
120 |
|
|
file { "/usr/local/bin/mdv-youri-submit.wrapper": |
121 |
|
|
owner => root, |
122 |
|
|
group => root, |
123 |
|
|
mode => 755, |
124 |
|
|
content => template("buildsystem/mdv-youri-submit.wrapper") |
125 |
|
|
} |
126 |
|
|
|
127 |
|
|
file { "/etc/sudoers.d/mdv-youri-submit": |
128 |
|
|
owner => root, |
129 |
|
|
group => root, |
130 |
|
|
mode => 440, |
131 |
|
|
content => template("buildsystem/sudoers.youri") |
132 |
|
|
} |
133 |
blino |
543 |
|
134 |
|
|
file { "/etc/youri": |
135 |
|
|
ensure => "directory", |
136 |
|
|
} |
137 |
|
|
|
138 |
|
|
file { "/etc/youri/submit-todo.conf": |
139 |
|
|
ensure => present, |
140 |
|
|
mode => 644, |
141 |
|
|
require => File["/etc/youri"], |
142 |
|
|
content => template("buildsystem/submit-todo.conf") |
143 |
|
|
} |
144 |
pterjan |
682 |
|
145 |
|
|
file { "/etc/youri/submit-queue.conf": |
146 |
|
|
ensure => present, |
147 |
|
|
mode => 644, |
148 |
|
|
require => File["/etc/youri"], |
149 |
|
|
content => template("buildsystem/submit-queue.conf") |
150 |
|
|
} |
151 |
blino |
516 |
} |
152 |
|
|
|
153 |
blino |
394 |
define sshuser($homedir, $comment) { |
154 |
|
|
group {"$title": |
155 |
blino |
351 |
ensure => present, |
156 |
|
|
} |
157 |
|
|
|
158 |
blino |
394 |
user {"$title": |
159 |
blino |
351 |
ensure => present, |
160 |
blino |
393 |
comment => $comment, |
161 |
blino |
351 |
managehome => true, |
162 |
blino |
394 |
gid => $title, |
163 |
blino |
351 |
shell => "/bin/bash", |
164 |
blino |
394 |
notify => Exec["unlock$title"], |
165 |
blino |
424 |
require => Group[$title], |
166 |
blino |
351 |
} |
167 |
blino |
372 |
|
168 |
blino |
386 |
# set password to * to unlock the account but forbid login through login |
169 |
blino |
394 |
exec { "unlock$title": |
170 |
|
|
command => "usermod -p '*' $title", |
171 |
blino |
386 |
refreshonly => true, |
172 |
|
|
} |
173 |
|
|
|
174 |
blino |
393 |
file { $homedir: |
175 |
blino |
383 |
ensure => "directory", |
176 |
blino |
423 |
require => User[$title], |
177 |
blino |
383 |
} |
178 |
|
|
|
179 |
blino |
393 |
file { "$homedir/.ssh": |
180 |
blino |
372 |
ensure => "directory", |
181 |
|
|
mode => 600, |
182 |
blino |
394 |
owner => $title, |
183 |
|
|
group => $title, |
184 |
blino |
423 |
require => File[$homedir], |
185 |
blino |
372 |
} |
186 |
blino |
351 |
} |
187 |
|
|
|
188 |
blino |
393 |
class iurtuser { |
189 |
blino |
394 |
sshuser { $build_login: |
190 |
|
|
homedir => $build_home_dir, |
191 |
|
|
comment => "System user used to run build bots", |
192 |
|
|
} |
193 |
blino |
429 |
|
194 |
|
|
file { "/etc/iurt": |
195 |
|
|
ensure => "directory", |
196 |
|
|
} |
197 |
blino |
393 |
} |
198 |
|
|
|
199 |
misc |
213 |
class iurt { |
200 |
boklm |
216 |
include sudo |
201 |
blino |
381 |
include iurtuser |
202 |
blino |
366 |
ssh::auth::client { $build_login: } |
203 |
blino |
396 |
ssh::auth::server { $sched_login: user => $build_login } |
204 |
misc |
213 |
|
205 |
|
|
# build node common settings |
206 |
|
|
# we could have the following skip list to use less space: |
207 |
|
|
# '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/' |
208 |
|
|
$package_list = ['task-bs-cluster-chroot', 'iurt'] |
209 |
|
|
package { $package_list: |
210 |
|
|
ensure => installed; |
211 |
|
|
} |
212 |
|
|
|
213 |
blino |
426 |
file { "/etc/iurt/build": |
214 |
|
|
ensure => "directory", |
215 |
blino |
428 |
require => File["/etc/iurt"], |
216 |
blino |
426 |
} |
217 |
|
|
|
218 |
blino |
425 |
file { "/etc/iurt/build/cauldron.conf": |
219 |
misc |
213 |
ensure => present, |
220 |
|
|
owner => $build_login, |
221 |
|
|
group => $build_login, |
222 |
|
|
mode => 644, |
223 |
blino |
426 |
require => File["/etc/iurt/build"], |
224 |
boklm |
218 |
content => template("buildsystem/iurt.cauldron.conf") |
225 |
misc |
213 |
} |
226 |
|
|
|
227 |
boklm |
648 |
file { "/etc/iurt/build/mandriva2010.1.conf": |
228 |
|
|
ensure => present, |
229 |
|
|
owner => $build_login, |
230 |
|
|
group => $build_login, |
231 |
|
|
mode => 644, |
232 |
|
|
require => File["/etc/iurt/build"], |
233 |
|
|
content => template("buildsystem/iurt.mandriva2010.1.conf") |
234 |
|
|
} |
235 |
|
|
|
236 |
boklm |
216 |
file { "/etc/sudoers.d/iurt": |
237 |
|
|
ensure => present, |
238 |
|
|
owner => root, |
239 |
|
|
group => root, |
240 |
boklm |
219 |
mode => 440, |
241 |
boklm |
218 |
content => template("buildsystem/sudoers.iurt") |
242 |
boklm |
216 |
} |
243 |
dmorgan |
86 |
} |
244 |
|
|
} |