/[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 886 - (hide annotations) (download)
Mon Jan 24 01:32:06 2011 UTC (13 years, 3 months ago) by misc
File size: 8564 byte(s)
- create ~schedbot/uploads hierarchy using a ruby dsl module ( see
http://projects.puppetlabs.com/projects/1/wiki/Ruby_Dsl )
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     file { "$sched_home_dir/uploads":
122     ensure => "directory",
123     owner => $sched_login,
124     require => File[$sched_home_dir],
125     }
126 misc 886
127     # too tedious to create everything by hand
128     # so I prefered to used some puppet ruby module
129     # the exact content and directory name should IMHO be consolidated somewhere
130     import "create_upload_dir.rb"
131     create_upload_dir { "$sched_home_dir/uploads":
132     owner => $sched_login,
133     }
134 misc 265 }
135    
136 blino 516 class youri_submit {
137 boklm 522 include sudo
138    
139 blino 516 file { "/usr/local/bin/mdv-youri-submit":
140     owner => root,
141     group => root,
142     mode => 755,
143     content => template("buildsystem/mdv-youri-submit")
144     }
145    
146     file { "/usr/local/bin/mdv-youri-submit.wrapper":
147     owner => root,
148     group => root,
149     mode => 755,
150     content => template("buildsystem/mdv-youri-submit.wrapper")
151     }
152    
153 boklm 770 sudo::sudoers_config { "mdv-youri-submit":
154 blino 516 content => template("buildsystem/sudoers.youri")
155     }
156 blino 543
157     file { "/etc/youri":
158     ensure => "directory",
159     }
160    
161     file { "/etc/youri/submit-todo.conf":
162     ensure => present,
163     mode => 644,
164     require => File["/etc/youri"],
165     content => template("buildsystem/submit-todo.conf")
166     }
167 pterjan 682
168 pterjan 685 file { "/etc/youri/submit-upload.conf":
169 pterjan 682 ensure => present,
170     mode => 644,
171     require => File["/etc/youri"],
172 pterjan 685 content => template("buildsystem/submit-upload.conf")
173 pterjan 682 }
174 boklm 772
175     file { "/etc/youri/acl.conf":
176     ensure => present,
177     mode => 644,
178     require => File["/etc/youri"],
179     content => template("buildsystem/youri_acl.conf")
180     }
181 boklm 817
182     file { '/usr/local/bin/submit_package':
183     ensure => present,
184     mode => 755,
185     content => template('buildsystem/submit_package')
186     }
187 blino 516 }
188    
189 boklm 862 # $groups: array of secondary groups (only local groups, no ldap)
190     define sshuser($homedir, $comment, $groups = []) {
191 blino 394 group {"$title":
192 blino 351 ensure => present,
193     }
194    
195 blino 394 user {"$title":
196 blino 351 ensure => present,
197 blino 393 comment => $comment,
198 blino 351 managehome => true,
199 blino 394 gid => $title,
200 boklm 862 groups => $groups,
201 blino 351 shell => "/bin/bash",
202 blino 394 notify => Exec["unlock$title"],
203 blino 424 require => Group[$title],
204 blino 351 }
205 blino 372
206 blino 386 # set password to * to unlock the account but forbid login through login
207 blino 394 exec { "unlock$title":
208     command => "usermod -p '*' $title",
209 blino 386 refreshonly => true,
210     }
211    
212 blino 393 file { $homedir:
213 blino 383 ensure => "directory",
214 blino 423 require => User[$title],
215 blino 383 }
216    
217 blino 393 file { "$homedir/.ssh":
218 blino 372 ensure => "directory",
219     mode => 600,
220 blino 394 owner => $title,
221     group => $title,
222 blino 423 require => File[$homedir],
223 blino 372 }
224 blino 351 }
225    
226 blino 393 class iurtuser {
227 blino 394 sshuser { $build_login:
228     homedir => $build_home_dir,
229     comment => "System user used to run build bots",
230     }
231 blino 429
232     file { "/etc/iurt":
233     ensure => "directory",
234     }
235 blino 393 }
236    
237 misc 213 class iurt {
238 boklm 216 include sudo
239 blino 381 include iurtuser
240 blino 366 ssh::auth::client { $build_login: }
241 blino 396 ssh::auth::server { $sched_login: user => $build_login }
242 misc 213
243     # build node common settings
244     # we could have the following skip list to use less space:
245     # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
246     $package_list = ['task-bs-cluster-chroot', 'iurt']
247     package { $package_list:
248     ensure => installed;
249     }
250    
251 blino 426 file { "/etc/iurt/build":
252     ensure => "directory",
253 blino 428 require => File["/etc/iurt"],
254 blino 426 }
255    
256 blino 425 file { "/etc/iurt/build/cauldron.conf":
257 misc 213 ensure => present,
258     owner => $build_login,
259     group => $build_login,
260     mode => 644,
261 blino 426 require => File["/etc/iurt/build"],
262 boklm 218 content => template("buildsystem/iurt.cauldron.conf")
263 misc 213 }
264    
265 boklm 648 file { "/etc/iurt/build/mandriva2010.1.conf":
266     ensure => present,
267     owner => $build_login,
268     group => $build_login,
269     mode => 644,
270     require => File["/etc/iurt/build"],
271     content => template("buildsystem/iurt.mandriva2010.1.conf")
272     }
273    
274 boklm 770 sudo::sudoers_config { "iurt":
275 boklm 218 content => template("buildsystem/sudoers.iurt")
276 boklm 216 }
277 dmorgan 86 }
278 boklm 696
279     # temporary script to create home dir with ssh key
280     # taking login and url as arguments
281     class mgacreatehome {
282     file { "/usr/local/sbin/mgacreatehome":
283     ensure => present,
284     owner => root,
285     group => root,
286     mode => 700,
287     content => template("buildsystem/mgacreatehome")
288     }
289     }
290 misc 859
291     class check_missing_deps {
292     file { "/usr/local/bin/missing-deps.sh":
293     ensure => present,
294     owner => root,
295     group => root,
296 boklm 869 mode => 755,
297 boklm 868 source => "puppet:///modules/buildsystem/missing-deps.sh",
298 misc 859 }
299    
300     # FIXME hardcoded path
301     cron { "check missing deps":
302     command => "cd /var/www/bs/data && /usr/local/bin/missing-deps.sh",
303     minute => "*/15",
304     }
305     }
306 dmorgan 86 }

  ViewVC Help
Powered by ViewVC 1.1.30