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

  ViewVC Help
Powered by ViewVC 1.1.30