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

  ViewVC Help
Powered by ViewVC 1.1.30