/[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 1842 - (hide annotations) (download)
Tue Jul 12 14:29:47 2011 UTC (12 years, 9 months ago) by boklm
File size: 13977 byte(s)
fix cron name
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 boklm 1829
150 boklm 1838 class maintdb inherits base {
151 boklm 1837 include sudo
152 boklm 1829 $maintdb_login = "maintdb"
153     $maintdb_homedir = "/var/lib/maintdb"
154 boklm 1834 $maintdb_dbdir = "$maintdb_homedir/db"
155 boklm 1829 $maintdb_binpath = "/usr/local/sbin/maintdb"
156     $maintdb_wrappath = "/usr/local/bin/wrapper.maintdb"
157    
158     user {"$maintdb_login":
159     ensure => present,
160     comment => "Maintainers database",
161     managehome => true,
162     shell => "/bin/bash",
163     home => "$maintdb_homedir",
164     }
165    
166     file { "$maintdb_dbdir":
167     ensure => directory,
168     owner => "$maintdb_login",
169     group => "$maintdb_login",
170     mode => 700,
171     require => User["$maintdb_login"],
172     }
173    
174     file { "$maintdb_binpath":
175     ensure => present,
176     owner => root,
177     group => root,
178     mode => 755,
179     content => template("buildsystem/maintdb")
180     }
181    
182     file { "$maintdb_wrappath":
183     ensure => present,
184     owner => root,
185     group => root,
186     mode => 755,
187     content => template("buildsystem/wrapper.maintdb")
188     }
189 boklm 1837
190     sudo::sudoers_config { "maintdb":
191     content => template("buildsystem/sudoers.maintdb")
192     }
193    
194 boklm 1842 cron { "update maintdb export":
195 boklm 1841 command => "sudo -u $maintdb_login $maintdb_binpath root get > /var/www/bs/data/maintdb.txt",
196     minute => "10,40",
197     }
198    
199 boklm 1829 }
200 misc 265
201 pterjan 700 class mgarepo {
202     package { 'mgarepo':
203 misc 265
204     }
205    
206 blino 505 package { 'rpm-build':
207     }
208    
209 blino 500 file { "repsys.conf":
210     path => "/etc/repsys.conf",
211     owner => root,
212     group => root,
213     mode => 644,
214     content => template("buildsystem/repsys.conf")
215     }
216 blino 502
217 boklm 1223 file { "$packages_archivedir":
218     ensure => "directory",
219     owner => $sched_login,
220     require => File[$sched_home_dir],
221     }
222    
223 blino 502 file { "$sched_home_dir/repsys":
224     ensure => "directory",
225 blino 508 owner => $sched_login,
226 blino 502 require => File[$sched_home_dir],
227     }
228    
229 misc 1484 file { ["$sched_home_dir/repsys/tmp", "$sched_home_dir/repsys/srpms"]:
230 blino 502 ensure => "directory",
231 blino 508 owner => $sched_login,
232 boklm 512 group => "mga-packagers",
233 boklm 510 mode => 1775,
234 blino 502 require => File["$sched_home_dir/repsys"],
235     }
236    
237 boklm 915 # FIXME: disabled temporarly as upload dir is a symlink to /var/lib/repsys/uploads
238     #file { "$sched_home_dir/uploads":
239     # ensure => "directory",
240     # owner => $sched_login,
241     # require => File[$sched_home_dir],
242     #}
243 misc 886
244     # too tedious to create everything by hand
245     # so I prefered to used some puppet ruby module
246     # the exact content and directory name should IMHO be consolidated somewhere
247     import "create_upload_dir.rb"
248 boklm 915 create_upload_dir { "$sched_home_dir/uploads":
249     owner => $sched_login,
250 boklm 968 group => $sched_login,
251 boklm 915 }
252 pterjan 1511
253 pterjan 1515 tidy { "$sched_home_dir/uploads":
254 pterjan 1511 age => "2w",
255     recurse => true,
256     type => "ctime",
257     }
258 pterjan 1224
259     tidy { "$packages_archivedir":
260 pterjan 1225 age => "1w",
261 pterjan 1224 matches => "*.rpm",
262     recurse => true,
263 pterjan 1226 type => "ctime",
264 pterjan 1224 }
265 misc 265 }
266    
267 blino 516 class youri_submit {
268 boklm 522 include sudo
269    
270 blino 1469 file { "/usr/local/bin/mga-youri-submit":
271 blino 516 owner => root,
272     group => root,
273     mode => 755,
274 blino 1469 content => template("buildsystem/mga-youri-submit")
275 blino 516 }
276    
277 blino 1469 file { "/usr/local/bin/mga-youri-submit.wrapper":
278 blino 516 owner => root,
279     group => root,
280     mode => 755,
281 blino 1469 content => template("buildsystem/mga-youri-submit.wrapper")
282 blino 516 }
283    
284 blino 1469 sudo::sudoers_config { "mga-youri-submit":
285 blino 516 content => template("buildsystem/sudoers.youri")
286     }
287 blino 543
288     file { "/etc/youri":
289     ensure => "directory",
290     }
291    
292     file { "/etc/youri/submit-todo.conf":
293     ensure => present,
294     mode => 644,
295     require => File["/etc/youri"],
296     content => template("buildsystem/submit-todo.conf")
297     }
298 pterjan 682
299 pterjan 685 file { "/etc/youri/submit-upload.conf":
300 pterjan 682 ensure => present,
301     mode => 644,
302     require => File["/etc/youri"],
303 pterjan 685 content => template("buildsystem/submit-upload.conf")
304 pterjan 682 }
305 boklm 772
306     file { "/etc/youri/acl.conf":
307     ensure => present,
308     mode => 644,
309     require => File["/etc/youri"],
310     content => template("buildsystem/youri_acl.conf")
311     }
312 boklm 817
313     file { '/usr/local/bin/submit_package':
314     ensure => present,
315     mode => 755,
316     content => template('buildsystem/submit_package')
317     }
318 pterjan 1390
319     # FIXME use the correct perl directory
320     file { "/usr/lib/perl5/site_perl/5.10.1/Youri/Repository":
321     ensure => "directory",
322     }
323    
324     file { '/usr/lib/perl5/site_perl/5.10.1/Youri/Repository/Mageia.pm':
325     ensure => present,
326     mode => 644,
327     require => File["/usr/lib/perl5/site_perl/5.10.1/Youri/Repository"],
328     source => "puppet:///modules/buildsystem/Mageia.pm",
329     }
330    
331     $package_list = ['perl-SVN', 'mdv-distrib-tools', 'perl-Youri-Media',
332     'perl-Youri-Package', 'perl-Youri-Repository',
333 blino 1470 'perl-Youri-Utils', 'perl-Youri-Config', 'mga-youri-submit']
334 pterjan 1390
335     package { $package_list:
336     ensure => installed;
337     }
338 blino 516 }
339    
340 boklm 862 # $groups: array of secondary groups (only local groups, no ldap)
341     define sshuser($homedir, $comment, $groups = []) {
342 blino 394 group {"$title":
343 blino 351 ensure => present,
344     }
345    
346 blino 394 user {"$title":
347 blino 351 ensure => present,
348 blino 393 comment => $comment,
349 blino 351 managehome => true,
350 boklm 916 home => $homedir,
351 blino 394 gid => $title,
352 boklm 862 groups => $groups,
353 blino 351 shell => "/bin/bash",
354 blino 394 notify => Exec["unlock$title"],
355 blino 424 require => Group[$title],
356 blino 351 }
357 blino 372
358 blino 386 # set password to * to unlock the account but forbid login through login
359 blino 394 exec { "unlock$title":
360     command => "usermod -p '*' $title",
361 blino 386 refreshonly => true,
362     }
363    
364 blino 393 file { $homedir:
365 blino 383 ensure => "directory",
366 blino 423 require => User[$title],
367 blino 383 }
368    
369 blino 393 file { "$homedir/.ssh":
370 blino 372 ensure => "directory",
371     mode => 600,
372 blino 394 owner => $title,
373     group => $title,
374 blino 423 require => File[$homedir],
375 blino 372 }
376 blino 351 }
377    
378 blino 393 class iurtuser {
379 blino 394 sshuser { $build_login:
380     homedir => $build_home_dir,
381     comment => "System user used to run build bots",
382     }
383 blino 429
384     file { "/etc/iurt":
385     ensure => "directory",
386     }
387 blino 393 }
388    
389 misc 213 class iurt {
390 boklm 216 include sudo
391 blino 381 include iurtuser
392 blino 366 ssh::auth::client { $build_login: }
393 blino 396 ssh::auth::server { $sched_login: user => $build_login }
394 misc 213
395     # build node common settings
396     # we could have the following skip list to use less space:
397     # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
398     $package_list = ['task-bs-cluster-chroot', 'iurt']
399     package { $package_list:
400     ensure => installed;
401     }
402    
403 blino 426 file { "/etc/iurt/build":
404     ensure => "directory",
405 blino 428 require => File["/etc/iurt"],
406 blino 426 }
407    
408 blino 425 file { "/etc/iurt/build/cauldron.conf":
409 misc 213 ensure => present,
410     owner => $build_login,
411     group => $build_login,
412     mode => 644,
413 blino 426 require => File["/etc/iurt/build"],
414 boklm 218 content => template("buildsystem/iurt.cauldron.conf")
415 misc 213 }
416    
417 pterjan 1730 file { "/etc/iurt/build/1.conf":
418     ensure => present,
419     owner => $build_login,
420     group => $build_login,
421     mode => 644,
422     require => File["/etc/iurt/build"],
423     content => template("buildsystem/iurt.1.conf")
424     }
425    
426 boklm 648 file { "/etc/iurt/build/mandriva2010.1.conf":
427     ensure => present,
428     owner => $build_login,
429     group => $build_login,
430     mode => 644,
431     require => File["/etc/iurt/build"],
432     content => template("buildsystem/iurt.mandriva2010.1.conf")
433     }
434    
435 boklm 770 sudo::sudoers_config { "iurt":
436 boklm 218 content => template("buildsystem/sudoers.iurt")
437 boklm 216 }
438 dmorgan 86 }
439 boklm 696
440     # temporary script to create home dir with ssh key
441     # taking login and url as arguments
442     class mgacreatehome {
443     file { "/usr/local/sbin/mgacreatehome":
444     ensure => present,
445     owner => root,
446     group => root,
447     mode => 700,
448     content => template("buildsystem/mgacreatehome")
449     }
450     }
451 misc 859
452     class check_missing_deps {
453     file { "/usr/local/bin/missing-deps.sh":
454     ensure => present,
455     owner => root,
456     group => root,
457 boklm 869 mode => 755,
458 boklm 868 source => "puppet:///modules/buildsystem/missing-deps.sh",
459 misc 859 }
460    
461     # FIXME hardcoded path
462     cron { "check missing deps":
463     command => "cd /var/www/bs/data && /usr/local/bin/missing-deps.sh",
464     minute => "*/15",
465     }
466     }
467 boklm 1489
468 boklm 1646 class release {
469     subversion::snapshot { "/root/release":
470     source => "svn://svn.$domain/soft/release/trunk/",
471     }
472    
473     package { "hardlink":
474     ensure => "installed",
475     }
476     }
477    
478 boklm 1568 # A script to copy on valstar the 2010.1 rpms built on jonund
479     class sync20101 inherits base {
480     file { "/usr/local/bin/sync2010.1":
481     ensure => present,
482     owner => root,
483     group => root,
484     mode => 755,
485     content => template("buildsystem/sync2010.1"),
486     }
487     }
488    
489     # a script to build 2010.1 packages. used on jonund
490 boklm 1491 class iurt20101 inherits base {
491 boklm 1489 file { "/usr/local/bin/iurt2010.1":
492     ensure => present,
493     owner => root,
494     group => root,
495     mode => 755,
496 boklm 1492 content => template("buildsystem/iurt2010.1"),
497 boklm 1489 }
498     }
499 dmorgan 86 }

  ViewVC Help
Powered by ViewVC 1.1.30