/[adm]/puppet/modules/buildsystem/manifests/init.pp
ViewVC logotype

Annotation of /puppet/modules/buildsystem/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1730 - (hide annotations) (download)
Thu Jun 9 15:42:38 2011 UTC (12 years, 10 months ago) by pterjan
File size: 12760 byte(s)
Deploy 1 iurt config
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 boklm 917 $sched_home_dir = "/var/lib/$sched_login"
8 boklm 1223 $packages_archivedir = "$sched_home_dir/old"
9 boklm 861 $sign_login = "signbot"
10     $sign_home_dir = "/var/lib/$sign_login"
11 boklm 969 $sign_keydir = "$sign_home_dir/keys"
12     # FIXME: maybe keyid should be defined at an other place
13     $sign_keyid = "80420F66"
14 blino 545 $repository_root = "/distrib/bootstrap"
15 blino 1398 $mirror_root = "/distrib/mirror"
16 boklm 1388 $maintdb_url = 'http://www.maintdb2.mageia.org.uk/maintainers_packages/create'
17 boklm 1384 # FIXME: Test password. Real password should be in extdata.
18     $maintdb_key = 'm1g234'
19 boklm 817 $packagers_group = 'mga-packagers'
20     $createsrpm_path = '/usr/share/repsys/create-srpm'
21 blino 366
22     include ssh::auth
23 boklm 918 ssh::auth::key { $build_login: # declare a key for build bot: RSA, 2048 bits
24     home => $build_home_dir,
25     }
26     ssh::auth::key { $sched_login: # declare a key for sched bot: RSA, 2048 bits
27     home => $sched_home_dir,
28     }
29 boklm 356 }
30 boklm 355
31 boklm 356 class mainnode inherits base {
32 blino 381 include iurtuser
33 blino 353
34 blino 395 sshuser { $sched_login:
35     homedir => $sched_home_dir,
36     comment => "System user used to schedule builds",
37     }
38    
39 blino 399 ssh::auth::client { $sched_login: }
40 blino 573 ssh::auth::server { $sched_login: }
41 blino 399 ssh::auth::server { $build_login: }
42    
43 pterjan 703 # FIXME Add again task-bs-cluster-main when it will require mgarepo instead of repsys
44     $package_list = ['iurt']
45 blino 398 package { $package_list:
46 blino 350 ensure => "installed"
47     }
48 blino 403
49     apache::vhost_other_app { "repository.$domain":
50 blino 404 vhost_file => "buildsystem/vhost_repository.conf",
51 blino 403 }
52    
53 misc 1284 $location = "/var/www/bs"
54 misc 1283 apache::vhost_base { "pkgsubmit.$domain":
55     aliases => { "/uploads" => "$sched_home_dir/uploads" },
56 misc 1284 location => $location,
57 boklm 1300 content => template("buildsystem/vhost_pkgsubmit.conf"),
58 blino 466 }
59    
60 misc 1284 subversion::snapshot { $location:
61     source => "svn://svn.$domain/soft/buildsystem/web/",
62     }
63    
64 boklm 1582 file { "$repository_root/distrib/cauldron/i586/media/media_info/media.cfg":
65 boklm 1580 ensure => present,
66     owner => $sched_login,
67     group => $sched_login,
68     mode => 644,
69     source => "puppet:///modules/buildsystem/i586/media.cfg",
70     }
71    
72 boklm 1582 file { "$repository_root/distrib/cauldron/x86_64/media/media_info/media.cfg":
73 boklm 1580 ensure => present,
74     owner => $sched_login,
75     group => $sched_login,
76     mode => 644,
77     source => "puppet:///modules/buildsystem/x86_64/media.cfg",
78     }
79    
80 blino 430 include scheduler
81 blino 431 include gatherer
82 pterjan 700 include mgarepo
83 blino 517 include youri_submit
84 misc 860 include check_missing_deps
85 boklm 964 include signbot
86 blino 350 }
87    
88 boklm 356 class buildnode inherits base {
89 misc 213 include iurt
90 dmorgan 86 }
91    
92 boklm 964 class signbot {
93     sshuser { $sign_login:
94     homedir => $sign_home_dir,
95     comment => "System user used to sign packages",
96     groups => [$sched_login],
97     }
98    
99     gnupg::keys{"packages":
100     email => "packages@$domain",
101     #FIXME there should be a variable somewhere to change the name of the distribution
102     key_name => 'Mageia Packages',
103     login => $sign_login,
104     batchdir => "$sign_home_dir/batches",
105 boklm 969 keydir => $sign_keydir,
106 boklm 964 }
107 boklm 966
108     sudo::sudoers_config { "signpackage":
109     content => template("buildsystem/sudoers.signpackage")
110     }
111 boklm 976
112     file { "$sign_home_dir/.rpmmacros":
113     ensure => present,
114     owner => root,
115     group => root,
116     mode => 644,
117     content => template("buildsystem/signbot-rpmmacros")
118     }
119 boklm 1023
120     file { "/usr/local/bin/sign-check-package":
121     ensure => present,
122     owner => root,
123     group => root,
124     mode => 755,
125     content => template("buildsystem/sign-check-package")
126     }
127 boklm 964 }
128    
129 misc 265 class scheduler {
130     # ulri
131 blino 430 include iurtupload
132 misc 265 }
133    
134 blino 431 class gatherer {
135 misc 265 # emi
136 blino 430 include iurtupload
137 misc 265 }
138 blino 430
139     class iurtupload {
140 blino 432 file { "/etc/iurt/upload.conf":
141 blino 430 ensure => present,
142     owner => $build_login,
143     group => $build_login,
144     mode => 644,
145     require => File["/etc/iurt"],
146     content => template("buildsystem/upload.conf")
147     }
148     }
149 misc 265
150 pterjan 700 class mgarepo {
151     package { 'mgarepo':
152 misc 265
153     }
154    
155 blino 505 package { 'rpm-build':
156     }
157    
158 blino 500 file { "repsys.conf":
159     path => "/etc/repsys.conf",
160     owner => root,
161     group => root,
162     mode => 644,
163     content => template("buildsystem/repsys.conf")
164     }
165 blino 502
166 boklm 1223 file { "$packages_archivedir":
167     ensure => "directory",
168     owner => $sched_login,
169     require => File[$sched_home_dir],
170     }
171    
172 blino 502 file { "$sched_home_dir/repsys":
173     ensure => "directory",
174 blino 508 owner => $sched_login,
175 blino 502 require => File[$sched_home_dir],
176     }
177    
178 misc 1484 file { ["$sched_home_dir/repsys/tmp", "$sched_home_dir/repsys/srpms"]:
179 blino 502 ensure => "directory",
180 blino 508 owner => $sched_login,
181 boklm 512 group => "mga-packagers",
182 boklm 510 mode => 1775,
183 blino 502 require => File["$sched_home_dir/repsys"],
184     }
185    
186 boklm 915 # FIXME: disabled temporarly as upload dir is a symlink to /var/lib/repsys/uploads
187     #file { "$sched_home_dir/uploads":
188     # ensure => "directory",
189     # owner => $sched_login,
190     # require => File[$sched_home_dir],
191     #}
192 misc 886
193     # too tedious to create everything by hand
194     # so I prefered to used some puppet ruby module
195     # the exact content and directory name should IMHO be consolidated somewhere
196     import "create_upload_dir.rb"
197 boklm 915 create_upload_dir { "$sched_home_dir/uploads":
198     owner => $sched_login,
199 boklm 968 group => $sched_login,
200 boklm 915 }
201 pterjan 1511
202 pterjan 1515 tidy { "$sched_home_dir/uploads":
203 pterjan 1511 age => "2w",
204     recurse => true,
205     type => "ctime",
206     }
207 pterjan 1224
208     tidy { "$packages_archivedir":
209 pterjan 1225 age => "1w",
210 pterjan 1224 matches => "*.rpm",
211     recurse => true,
212 pterjan 1226 type => "ctime",
213 pterjan 1224 }
214 misc 265 }
215    
216 blino 516 class youri_submit {
217 boklm 522 include sudo
218    
219 blino 1469 file { "/usr/local/bin/mga-youri-submit":
220 blino 516 owner => root,
221     group => root,
222     mode => 755,
223 blino 1469 content => template("buildsystem/mga-youri-submit")
224 blino 516 }
225    
226 blino 1469 file { "/usr/local/bin/mga-youri-submit.wrapper":
227 blino 516 owner => root,
228     group => root,
229     mode => 755,
230 blino 1469 content => template("buildsystem/mga-youri-submit.wrapper")
231 blino 516 }
232    
233 blino 1469 sudo::sudoers_config { "mga-youri-submit":
234 blino 516 content => template("buildsystem/sudoers.youri")
235     }
236 blino 543
237     file { "/etc/youri":
238     ensure => "directory",
239     }
240    
241     file { "/etc/youri/submit-todo.conf":
242     ensure => present,
243     mode => 644,
244     require => File["/etc/youri"],
245     content => template("buildsystem/submit-todo.conf")
246     }
247 pterjan 682
248 pterjan 685 file { "/etc/youri/submit-upload.conf":
249 pterjan 682 ensure => present,
250     mode => 644,
251     require => File["/etc/youri"],
252 pterjan 685 content => template("buildsystem/submit-upload.conf")
253 pterjan 682 }
254 boklm 772
255     file { "/etc/youri/acl.conf":
256     ensure => present,
257     mode => 644,
258     require => File["/etc/youri"],
259     content => template("buildsystem/youri_acl.conf")
260     }
261 boklm 817
262     file { '/usr/local/bin/submit_package':
263     ensure => present,
264     mode => 755,
265     content => template('buildsystem/submit_package')
266     }
267 pterjan 1390
268     # FIXME use the correct perl directory
269     file { "/usr/lib/perl5/site_perl/5.10.1/Youri/Repository":
270     ensure => "directory",
271     }
272    
273     file { '/usr/lib/perl5/site_perl/5.10.1/Youri/Repository/Mageia.pm':
274     ensure => present,
275     mode => 644,
276     require => File["/usr/lib/perl5/site_perl/5.10.1/Youri/Repository"],
277     source => "puppet:///modules/buildsystem/Mageia.pm",
278     }
279    
280     $package_list = ['perl-SVN', 'mdv-distrib-tools', 'perl-Youri-Media',
281     'perl-Youri-Package', 'perl-Youri-Repository',
282 blino 1470 'perl-Youri-Utils', 'perl-Youri-Config', 'mga-youri-submit']
283 pterjan 1390
284     package { $package_list:
285     ensure => installed;
286     }
287 blino 516 }
288    
289 boklm 862 # $groups: array of secondary groups (only local groups, no ldap)
290     define sshuser($homedir, $comment, $groups = []) {
291 blino 394 group {"$title":
292 blino 351 ensure => present,
293     }
294    
295 blino 394 user {"$title":
296 blino 351 ensure => present,
297 blino 393 comment => $comment,
298 blino 351 managehome => true,
299 boklm 916 home => $homedir,
300 blino 394 gid => $title,
301 boklm 862 groups => $groups,
302 blino 351 shell => "/bin/bash",
303 blino 394 notify => Exec["unlock$title"],
304 blino 424 require => Group[$title],
305 blino 351 }
306 blino 372
307 blino 386 # set password to * to unlock the account but forbid login through login
308 blino 394 exec { "unlock$title":
309     command => "usermod -p '*' $title",
310 blino 386 refreshonly => true,
311     }
312    
313 blino 393 file { $homedir:
314 blino 383 ensure => "directory",
315 blino 423 require => User[$title],
316 blino 383 }
317    
318 blino 393 file { "$homedir/.ssh":
319 blino 372 ensure => "directory",
320     mode => 600,
321 blino 394 owner => $title,
322     group => $title,
323 blino 423 require => File[$homedir],
324 blino 372 }
325 blino 351 }
326    
327 blino 393 class iurtuser {
328 blino 394 sshuser { $build_login:
329     homedir => $build_home_dir,
330     comment => "System user used to run build bots",
331     }
332 blino 429
333     file { "/etc/iurt":
334     ensure => "directory",
335     }
336 blino 393 }
337    
338 misc 213 class iurt {
339 boklm 216 include sudo
340 blino 381 include iurtuser
341 blino 366 ssh::auth::client { $build_login: }
342 blino 396 ssh::auth::server { $sched_login: user => $build_login }
343 misc 213
344     # build node common settings
345     # we could have the following skip list to use less space:
346     # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
347     $package_list = ['task-bs-cluster-chroot', 'iurt']
348     package { $package_list:
349     ensure => installed;
350     }
351    
352 blino 426 file { "/etc/iurt/build":
353     ensure => "directory",
354 blino 428 require => File["/etc/iurt"],
355 blino 426 }
356    
357 blino 425 file { "/etc/iurt/build/cauldron.conf":
358 misc 213 ensure => present,
359     owner => $build_login,
360     group => $build_login,
361     mode => 644,
362 blino 426 require => File["/etc/iurt/build"],
363 boklm 218 content => template("buildsystem/iurt.cauldron.conf")
364 misc 213 }
365    
366 pterjan 1730 file { "/etc/iurt/build/1.conf":
367     ensure => present,
368     owner => $build_login,
369     group => $build_login,
370     mode => 644,
371     require => File["/etc/iurt/build"],
372     content => template("buildsystem/iurt.1.conf")
373     }
374    
375 boklm 648 file { "/etc/iurt/build/mandriva2010.1.conf":
376     ensure => present,
377     owner => $build_login,
378     group => $build_login,
379     mode => 644,
380     require => File["/etc/iurt/build"],
381     content => template("buildsystem/iurt.mandriva2010.1.conf")
382     }
383    
384 boklm 770 sudo::sudoers_config { "iurt":
385 boklm 218 content => template("buildsystem/sudoers.iurt")
386 boklm 216 }
387 dmorgan 86 }
388 boklm 696
389     # temporary script to create home dir with ssh key
390     # taking login and url as arguments
391     class mgacreatehome {
392     file { "/usr/local/sbin/mgacreatehome":
393     ensure => present,
394     owner => root,
395     group => root,
396     mode => 700,
397     content => template("buildsystem/mgacreatehome")
398     }
399     }
400 misc 859
401     class check_missing_deps {
402     file { "/usr/local/bin/missing-deps.sh":
403     ensure => present,
404     owner => root,
405     group => root,
406 boklm 869 mode => 755,
407 boklm 868 source => "puppet:///modules/buildsystem/missing-deps.sh",
408 misc 859 }
409    
410     # FIXME hardcoded path
411     cron { "check missing deps":
412     command => "cd /var/www/bs/data && /usr/local/bin/missing-deps.sh",
413     minute => "*/15",
414     }
415     }
416 boklm 1489
417 boklm 1646 class release {
418     subversion::snapshot { "/root/release":
419     source => "svn://svn.$domain/soft/release/trunk/",
420     }
421    
422     package { "hardlink":
423     ensure => "installed",
424     }
425     }
426    
427 boklm 1568 # A script to copy on valstar the 2010.1 rpms built on jonund
428     class sync20101 inherits base {
429     file { "/usr/local/bin/sync2010.1":
430     ensure => present,
431     owner => root,
432     group => root,
433     mode => 755,
434     content => template("buildsystem/sync2010.1"),
435     }
436     }
437    
438     # a script to build 2010.1 packages. used on jonund
439 boklm 1491 class iurt20101 inherits base {
440 boklm 1489 file { "/usr/local/bin/iurt2010.1":
441     ensure => present,
442     owner => root,
443     group => root,
444     mode => 755,
445 boklm 1492 content => template("buildsystem/iurt2010.1"),
446 boklm 1489 }
447     }
448 dmorgan 86 }

  ViewVC Help
Powered by ViewVC 1.1.30