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

  ViewVC Help
Powered by ViewVC 1.1.30