/[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 1514 - (hide annotations) (download)
Mon Apr 11 22:31:51 2011 UTC (13 years ago) by pterjan
File size: 11474 byte(s)
Try to fix the tidy of upload files
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 blino 430 include scheduler
65 blino 431 include gatherer
66 pterjan 700 include mgarepo
67 blino 517 include youri_submit
68 misc 860 include check_missing_deps
69 boklm 964 include signbot
70 blino 350 }
71    
72 boklm 356 class buildnode inherits base {
73 misc 213 include iurt
74 dmorgan 86 }
75    
76 boklm 964 class signbot {
77     sshuser { $sign_login:
78     homedir => $sign_home_dir,
79     comment => "System user used to sign packages",
80     groups => [$sched_login],
81     }
82    
83     gnupg::keys{"packages":
84     email => "packages@$domain",
85     #FIXME there should be a variable somewhere to change the name of the distribution
86     key_name => 'Mageia Packages',
87     login => $sign_login,
88     batchdir => "$sign_home_dir/batches",
89 boklm 969 keydir => $sign_keydir,
90 boklm 964 }
91 boklm 966
92     sudo::sudoers_config { "signpackage":
93     content => template("buildsystem/sudoers.signpackage")
94     }
95 boklm 976
96     file { "$sign_home_dir/.rpmmacros":
97     ensure => present,
98     owner => root,
99     group => root,
100     mode => 644,
101     content => template("buildsystem/signbot-rpmmacros")
102     }
103 boklm 1023
104     file { "/usr/local/bin/sign-check-package":
105     ensure => present,
106     owner => root,
107     group => root,
108     mode => 755,
109     content => template("buildsystem/sign-check-package")
110     }
111 boklm 964 }
112    
113 misc 265 class scheduler {
114     # ulri
115 blino 430 include iurtupload
116 misc 265 }
117    
118 blino 431 class gatherer {
119 misc 265 # emi
120 blino 430 include iurtupload
121 misc 265 }
122 blino 430
123     class iurtupload {
124 blino 432 file { "/etc/iurt/upload.conf":
125 blino 430 ensure => present,
126     owner => $build_login,
127     group => $build_login,
128     mode => 644,
129     require => File["/etc/iurt"],
130     content => template("buildsystem/upload.conf")
131     }
132     }
133 misc 265
134 pterjan 700 class mgarepo {
135     package { 'mgarepo':
136 misc 265
137     }
138    
139 blino 505 package { 'rpm-build':
140     }
141    
142 blino 500 file { "repsys.conf":
143     path => "/etc/repsys.conf",
144     owner => root,
145     group => root,
146     mode => 644,
147     content => template("buildsystem/repsys.conf")
148     }
149 blino 502
150 boklm 1223 file { "$packages_archivedir":
151     ensure => "directory",
152     owner => $sched_login,
153     require => File[$sched_home_dir],
154     }
155    
156 blino 502 file { "$sched_home_dir/repsys":
157     ensure => "directory",
158 blino 508 owner => $sched_login,
159 blino 502 require => File[$sched_home_dir],
160     }
161    
162 misc 1484 file { ["$sched_home_dir/repsys/tmp", "$sched_home_dir/repsys/srpms"]:
163 blino 502 ensure => "directory",
164 blino 508 owner => $sched_login,
165 boklm 512 group => "mga-packagers",
166 boklm 510 mode => 1775,
167 blino 502 require => File["$sched_home_dir/repsys"],
168     }
169    
170 boklm 915 # FIXME: disabled temporarly as upload dir is a symlink to /var/lib/repsys/uploads
171     #file { "$sched_home_dir/uploads":
172     # ensure => "directory",
173     # owner => $sched_login,
174     # require => File[$sched_home_dir],
175     #}
176 misc 886
177     # too tedious to create everything by hand
178     # so I prefered to used some puppet ruby module
179     # the exact content and directory name should IMHO be consolidated somewhere
180     import "create_upload_dir.rb"
181 boklm 915 create_upload_dir { "$sched_home_dir/uploads":
182     owner => $sched_login,
183 boklm 968 group => $sched_login,
184 boklm 915 }
185 pterjan 1511
186     tidy { "$sched_home_dir/uploads/":
187     age => "2w",
188 pterjan 1514 matches => "*",
189 pterjan 1511 recurse => true,
190     type => "ctime",
191     }
192 pterjan 1224
193     tidy { "$packages_archivedir":
194 pterjan 1225 age => "1w",
195 pterjan 1224 matches => "*.rpm",
196     recurse => true,
197 pterjan 1226 type => "ctime",
198 pterjan 1224 }
199 misc 265 }
200    
201 blino 516 class youri_submit {
202 boklm 522 include sudo
203    
204 blino 1469 file { "/usr/local/bin/mga-youri-submit":
205 blino 516 owner => root,
206     group => root,
207     mode => 755,
208 blino 1469 content => template("buildsystem/mga-youri-submit")
209 blino 516 }
210    
211 blino 1469 file { "/usr/local/bin/mga-youri-submit.wrapper":
212 blino 516 owner => root,
213     group => root,
214     mode => 755,
215 blino 1469 content => template("buildsystem/mga-youri-submit.wrapper")
216 blino 516 }
217    
218 blino 1469 sudo::sudoers_config { "mga-youri-submit":
219 blino 516 content => template("buildsystem/sudoers.youri")
220     }
221 blino 543
222     file { "/etc/youri":
223     ensure => "directory",
224     }
225    
226     file { "/etc/youri/submit-todo.conf":
227     ensure => present,
228     mode => 644,
229     require => File["/etc/youri"],
230     content => template("buildsystem/submit-todo.conf")
231     }
232 pterjan 682
233 pterjan 685 file { "/etc/youri/submit-upload.conf":
234 pterjan 682 ensure => present,
235     mode => 644,
236     require => File["/etc/youri"],
237 pterjan 685 content => template("buildsystem/submit-upload.conf")
238 pterjan 682 }
239 boklm 772
240     file { "/etc/youri/acl.conf":
241     ensure => present,
242     mode => 644,
243     require => File["/etc/youri"],
244     content => template("buildsystem/youri_acl.conf")
245     }
246 boklm 817
247     file { '/usr/local/bin/submit_package':
248     ensure => present,
249     mode => 755,
250     content => template('buildsystem/submit_package')
251     }
252 pterjan 1390
253     # FIXME use the correct perl directory
254     file { "/usr/lib/perl5/site_perl/5.10.1/Youri/Repository":
255     ensure => "directory",
256     }
257    
258     file { '/usr/lib/perl5/site_perl/5.10.1/Youri/Repository/Mageia.pm':
259     ensure => present,
260     mode => 644,
261     require => File["/usr/lib/perl5/site_perl/5.10.1/Youri/Repository"],
262     source => "puppet:///modules/buildsystem/Mageia.pm",
263     }
264    
265     $package_list = ['perl-SVN', 'mdv-distrib-tools', 'perl-Youri-Media',
266     'perl-Youri-Package', 'perl-Youri-Repository',
267 blino 1470 'perl-Youri-Utils', 'perl-Youri-Config', 'mga-youri-submit']
268 pterjan 1390
269     package { $package_list:
270     ensure => installed;
271     }
272 blino 516 }
273    
274 boklm 862 # $groups: array of secondary groups (only local groups, no ldap)
275     define sshuser($homedir, $comment, $groups = []) {
276 blino 394 group {"$title":
277 blino 351 ensure => present,
278     }
279    
280 blino 394 user {"$title":
281 blino 351 ensure => present,
282 blino 393 comment => $comment,
283 blino 351 managehome => true,
284 boklm 916 home => $homedir,
285 blino 394 gid => $title,
286 boklm 862 groups => $groups,
287 blino 351 shell => "/bin/bash",
288 blino 394 notify => Exec["unlock$title"],
289 blino 424 require => Group[$title],
290 blino 351 }
291 blino 372
292 blino 386 # set password to * to unlock the account but forbid login through login
293 blino 394 exec { "unlock$title":
294     command => "usermod -p '*' $title",
295 blino 386 refreshonly => true,
296     }
297    
298 blino 393 file { $homedir:
299 blino 383 ensure => "directory",
300 blino 423 require => User[$title],
301 blino 383 }
302    
303 blino 393 file { "$homedir/.ssh":
304 blino 372 ensure => "directory",
305     mode => 600,
306 blino 394 owner => $title,
307     group => $title,
308 blino 423 require => File[$homedir],
309 blino 372 }
310 blino 351 }
311    
312 blino 393 class iurtuser {
313 blino 394 sshuser { $build_login:
314     homedir => $build_home_dir,
315     comment => "System user used to run build bots",
316     }
317 blino 429
318     file { "/etc/iurt":
319     ensure => "directory",
320     }
321 blino 393 }
322    
323 misc 213 class iurt {
324 boklm 216 include sudo
325 blino 381 include iurtuser
326 blino 366 ssh::auth::client { $build_login: }
327 blino 396 ssh::auth::server { $sched_login: user => $build_login }
328 misc 213
329     # build node common settings
330     # we could have the following skip list to use less space:
331     # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
332     $package_list = ['task-bs-cluster-chroot', 'iurt']
333     package { $package_list:
334     ensure => installed;
335     }
336    
337 blino 426 file { "/etc/iurt/build":
338     ensure => "directory",
339 blino 428 require => File["/etc/iurt"],
340 blino 426 }
341    
342 blino 425 file { "/etc/iurt/build/cauldron.conf":
343 misc 213 ensure => present,
344     owner => $build_login,
345     group => $build_login,
346     mode => 644,
347 blino 426 require => File["/etc/iurt/build"],
348 boklm 218 content => template("buildsystem/iurt.cauldron.conf")
349 misc 213 }
350    
351 boklm 648 file { "/etc/iurt/build/mandriva2010.1.conf":
352     ensure => present,
353     owner => $build_login,
354     group => $build_login,
355     mode => 644,
356     require => File["/etc/iurt/build"],
357     content => template("buildsystem/iurt.mandriva2010.1.conf")
358     }
359    
360 boklm 770 sudo::sudoers_config { "iurt":
361 boklm 218 content => template("buildsystem/sudoers.iurt")
362 boklm 216 }
363 dmorgan 86 }
364 boklm 696
365     # temporary script to create home dir with ssh key
366     # taking login and url as arguments
367     class mgacreatehome {
368     file { "/usr/local/sbin/mgacreatehome":
369     ensure => present,
370     owner => root,
371     group => root,
372     mode => 700,
373     content => template("buildsystem/mgacreatehome")
374     }
375     }
376 misc 859
377     class check_missing_deps {
378     file { "/usr/local/bin/missing-deps.sh":
379     ensure => present,
380     owner => root,
381     group => root,
382 boklm 869 mode => 755,
383 boklm 868 source => "puppet:///modules/buildsystem/missing-deps.sh",
384 misc 859 }
385    
386     # FIXME hardcoded path
387     cron { "check missing deps":
388     command => "cd /var/www/bs/data && /usr/local/bin/missing-deps.sh",
389     minute => "*/15",
390     }
391     }
392 boklm 1489
393 boklm 1491 class iurt20101 inherits base {
394 boklm 1489 file { "/usr/local/bin/iurt2010.1":
395     ensure => present,
396     owner => root,
397     group => root,
398     mode => 755,
399 boklm 1492 content => template("buildsystem/iurt2010.1"),
400 boklm 1489 }
401     }
402 dmorgan 86 }

  ViewVC Help
Powered by ViewVC 1.1.30