/[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 915 - (hide annotations) (download)
Sat Jan 29 14:51:46 2011 UTC (13 years, 2 months ago) by boklm
File size: 8653 byte(s)
disable the right thing
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 boklm 861 $sign_login = "signbot"
9     $sign_home_dir = "/var/lib/$sign_login"
10 blino 545 $repository_root = "/distrib/bootstrap"
11 boklm 817 $packagers_group = 'mga-packagers'
12     $createsrpm_path = '/usr/share/repsys/create-srpm'
13 blino 366
14     include ssh::auth
15     ssh::auth::key { $build_login: } # declare a key for build bot: RSA, 2048 bits
16 blino 395 ssh::auth::key { $sched_login: } # declare a key for sched bot: RSA, 2048 bits
17 boklm 356 }
18 boklm 355
19 boklm 356 class mainnode inherits base {
20 blino 381 include iurtuser
21 blino 353
22 blino 395 sshuser { $sched_login:
23     homedir => $sched_home_dir,
24     comment => "System user used to schedule builds",
25     }
26    
27 boklm 861 sshuser { $sign_login:
28     homedir => $sign_home_dir,
29     comment => "System user used to sign packages",
30 boklm 867 groups => [$sched_login],
31 boklm 861 }
32    
33 blino 399 ssh::auth::client { $sched_login: }
34 blino 573 ssh::auth::server { $sched_login: }
35 blino 399 ssh::auth::server { $build_login: }
36    
37 pterjan 703 # FIXME Add again task-bs-cluster-main when it will require mgarepo instead of repsys
38     $package_list = ['iurt']
39 blino 398 package { $package_list:
40 blino 350 ensure => "installed"
41     }
42 blino 403
43     apache::vhost_other_app { "repository.$domain":
44 blino 404 vhost_file => "buildsystem/vhost_repository.conf",
45 blino 403 }
46    
47 blino 466 apache::vhost_other_app { "pkgsubmit.$domain":
48     vhost_file => "buildsystem/vhost_pkgsubmit.conf",
49     }
50    
51 blino 430 include scheduler
52 blino 431 include gatherer
53 pterjan 700 include mgarepo
54 blino 517 include youri_submit
55 misc 860 include check_missing_deps
56 blino 350 }
57    
58 boklm 356 class buildnode inherits base {
59 misc 213 include iurt
60 dmorgan 86 }
61    
62 misc 265 class scheduler {
63     # ulri
64 blino 430 include iurtupload
65 misc 265 }
66    
67 blino 431 class gatherer {
68 misc 265 # emi
69 blino 430 include iurtupload
70 misc 265 }
71 blino 430
72     class iurtupload {
73 blino 432 file { "/etc/iurt/upload.conf":
74 blino 430 ensure => present,
75     owner => $build_login,
76     group => $build_login,
77     mode => 644,
78     require => File["/etc/iurt"],
79     content => template("buildsystem/upload.conf")
80     }
81     }
82 misc 265
83 pterjan 700 class mgarepo {
84     package { 'mgarepo':
85 misc 265
86     }
87    
88 blino 505 package { 'rpm-build':
89     }
90    
91 blino 500 file { "repsys.conf":
92     path => "/etc/repsys.conf",
93     owner => root,
94     group => root,
95     mode => 644,
96     content => template("buildsystem/repsys.conf")
97     }
98 blino 502
99     file { "$sched_home_dir/repsys":
100     ensure => "directory",
101 blino 508 owner => $sched_login,
102 blino 502 require => File[$sched_home_dir],
103     }
104    
105     file { "$sched_home_dir/repsys/tmp":
106     ensure => "directory",
107 blino 508 owner => $sched_login,
108 boklm 512 group => "mga-packagers",
109 boklm 510 mode => 1775,
110 blino 502 require => File["$sched_home_dir/repsys"],
111     }
112    
113     file { "$sched_home_dir/repsys/srpms":
114     ensure => "directory",
115 blino 508 owner => $sched_login,
116 boklm 512 group => "mga-packagers",
117 boklm 510 mode => 1775,
118 blino 502 require => File["$sched_home_dir/repsys"],
119     }
120 blino 885
121 boklm 915 # FIXME: disabled temporarly as upload dir is a symlink to /var/lib/repsys/uploads
122     #file { "$sched_home_dir/uploads":
123     # ensure => "directory",
124     # owner => $sched_login,
125     # require => File[$sched_home_dir],
126     #}
127 misc 886
128     # too tedious to create everything by hand
129     # so I prefered to used some puppet ruby module
130     # the exact content and directory name should IMHO be consolidated somewhere
131     import "create_upload_dir.rb"
132 boklm 915 create_upload_dir { "$sched_home_dir/uploads":
133     owner => $sched_login,
134     }
135 misc 265 }
136    
137 blino 516 class youri_submit {
138 boklm 522 include sudo
139    
140 blino 516 file { "/usr/local/bin/mdv-youri-submit":
141     owner => root,
142     group => root,
143     mode => 755,
144     content => template("buildsystem/mdv-youri-submit")
145     }
146    
147     file { "/usr/local/bin/mdv-youri-submit.wrapper":
148     owner => root,
149     group => root,
150     mode => 755,
151     content => template("buildsystem/mdv-youri-submit.wrapper")
152     }
153    
154 boklm 770 sudo::sudoers_config { "mdv-youri-submit":
155 blino 516 content => template("buildsystem/sudoers.youri")
156     }
157 blino 543
158     file { "/etc/youri":
159     ensure => "directory",
160     }
161    
162     file { "/etc/youri/submit-todo.conf":
163     ensure => present,
164     mode => 644,
165     require => File["/etc/youri"],
166     content => template("buildsystem/submit-todo.conf")
167     }
168 pterjan 682
169 pterjan 685 file { "/etc/youri/submit-upload.conf":
170 pterjan 682 ensure => present,
171     mode => 644,
172     require => File["/etc/youri"],
173 pterjan 685 content => template("buildsystem/submit-upload.conf")
174 pterjan 682 }
175 boklm 772
176     file { "/etc/youri/acl.conf":
177     ensure => present,
178     mode => 644,
179     require => File["/etc/youri"],
180     content => template("buildsystem/youri_acl.conf")
181     }
182 boklm 817
183     file { '/usr/local/bin/submit_package':
184     ensure => present,
185     mode => 755,
186     content => template('buildsystem/submit_package')
187     }
188 blino 516 }
189    
190 boklm 862 # $groups: array of secondary groups (only local groups, no ldap)
191     define sshuser($homedir, $comment, $groups = []) {
192 blino 394 group {"$title":
193 blino 351 ensure => present,
194     }
195    
196 blino 394 user {"$title":
197 blino 351 ensure => present,
198 blino 393 comment => $comment,
199 blino 351 managehome => true,
200 blino 394 gid => $title,
201 boklm 862 groups => $groups,
202 blino 351 shell => "/bin/bash",
203 blino 394 notify => Exec["unlock$title"],
204 blino 424 require => Group[$title],
205 blino 351 }
206 blino 372
207 blino 386 # set password to * to unlock the account but forbid login through login
208 blino 394 exec { "unlock$title":
209     command => "usermod -p '*' $title",
210 blino 386 refreshonly => true,
211     }
212    
213 blino 393 file { $homedir:
214 blino 383 ensure => "directory",
215 blino 423 require => User[$title],
216 blino 383 }
217    
218 blino 393 file { "$homedir/.ssh":
219 blino 372 ensure => "directory",
220     mode => 600,
221 blino 394 owner => $title,
222     group => $title,
223 blino 423 require => File[$homedir],
224 blino 372 }
225 blino 351 }
226    
227 blino 393 class iurtuser {
228 blino 394 sshuser { $build_login:
229     homedir => $build_home_dir,
230     comment => "System user used to run build bots",
231     }
232 blino 429
233     file { "/etc/iurt":
234     ensure => "directory",
235     }
236 blino 393 }
237    
238 misc 213 class iurt {
239 boklm 216 include sudo
240 blino 381 include iurtuser
241 blino 366 ssh::auth::client { $build_login: }
242 blino 396 ssh::auth::server { $sched_login: user => $build_login }
243 misc 213
244     # build node common settings
245     # we could have the following skip list to use less space:
246     # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
247     $package_list = ['task-bs-cluster-chroot', 'iurt']
248     package { $package_list:
249     ensure => installed;
250     }
251    
252 blino 426 file { "/etc/iurt/build":
253     ensure => "directory",
254 blino 428 require => File["/etc/iurt"],
255 blino 426 }
256    
257 blino 425 file { "/etc/iurt/build/cauldron.conf":
258 misc 213 ensure => present,
259     owner => $build_login,
260     group => $build_login,
261     mode => 644,
262 blino 426 require => File["/etc/iurt/build"],
263 boklm 218 content => template("buildsystem/iurt.cauldron.conf")
264 misc 213 }
265    
266 boklm 648 file { "/etc/iurt/build/mandriva2010.1.conf":
267     ensure => present,
268     owner => $build_login,
269     group => $build_login,
270     mode => 644,
271     require => File["/etc/iurt/build"],
272     content => template("buildsystem/iurt.mandriva2010.1.conf")
273     }
274    
275 boklm 770 sudo::sudoers_config { "iurt":
276 boklm 218 content => template("buildsystem/sudoers.iurt")
277 boklm 216 }
278 dmorgan 86 }
279 boklm 696
280     # temporary script to create home dir with ssh key
281     # taking login and url as arguments
282     class mgacreatehome {
283     file { "/usr/local/sbin/mgacreatehome":
284     ensure => present,
285     owner => root,
286     group => root,
287     mode => 700,
288     content => template("buildsystem/mgacreatehome")
289     }
290     }
291 misc 859
292     class check_missing_deps {
293     file { "/usr/local/bin/missing-deps.sh":
294     ensure => present,
295     owner => root,
296     group => root,
297 boklm 869 mode => 755,
298 boklm 868 source => "puppet:///modules/buildsystem/missing-deps.sh",
299 misc 859 }
300    
301     # FIXME hardcoded path
302     cron { "check missing deps":
303     command => "cd /var/www/bs/data && /usr/local/bin/missing-deps.sh",
304     minute => "*/15",
305     }
306     }
307 dmorgan 86 }

  ViewVC Help
Powered by ViewVC 1.1.30