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 |
blino |
398 |
$package_list = ['task-bs-cluster-main', 'iurt'] |
28 |
|
|
package { $package_list: |
29 |
blino |
350 |
ensure => "installed" |
30 |
|
|
} |
31 |
blino |
403 |
|
32 |
|
|
apache::vhost_other_app { "repository.$domain": |
33 |
blino |
404 |
vhost_file => "buildsystem/vhost_repository.conf", |
34 |
blino |
403 |
} |
35 |
|
|
|
36 |
blino |
466 |
apache::vhost_other_app { "pkgsubmit.$domain": |
37 |
|
|
vhost_file => "buildsystem/vhost_pkgsubmit.conf", |
38 |
|
|
} |
39 |
|
|
|
40 |
blino |
430 |
include scheduler |
41 |
blino |
431 |
include gatherer |
42 |
blino |
500 |
include repsys |
43 |
blino |
517 |
include youri_submit |
44 |
blino |
350 |
} |
45 |
|
|
|
46 |
boklm |
356 |
class buildnode inherits base { |
47 |
misc |
213 |
include iurt |
48 |
dmorgan |
86 |
} |
49 |
|
|
|
50 |
misc |
265 |
class scheduler { |
51 |
|
|
# ulri |
52 |
blino |
430 |
include iurtupload |
53 |
misc |
265 |
} |
54 |
|
|
|
55 |
blino |
431 |
class gatherer { |
56 |
misc |
265 |
# emi |
57 |
blino |
430 |
include iurtupload |
58 |
misc |
265 |
} |
59 |
blino |
430 |
|
60 |
|
|
class iurtupload { |
61 |
blino |
432 |
file { "/etc/iurt/upload.conf": |
62 |
blino |
430 |
ensure => present, |
63 |
|
|
owner => $build_login, |
64 |
|
|
group => $build_login, |
65 |
|
|
mode => 644, |
66 |
|
|
require => File["/etc/iurt"], |
67 |
|
|
content => template("buildsystem/upload.conf") |
68 |
|
|
} |
69 |
|
|
} |
70 |
misc |
265 |
|
71 |
|
|
class repsys { |
72 |
|
|
package { 'repsys': |
73 |
|
|
|
74 |
|
|
} |
75 |
|
|
|
76 |
blino |
505 |
package { 'rpm-build': |
77 |
|
|
} |
78 |
|
|
|
79 |
blino |
500 |
file { "repsys.conf": |
80 |
|
|
path => "/etc/repsys.conf", |
81 |
|
|
owner => root, |
82 |
|
|
group => root, |
83 |
|
|
mode => 644, |
84 |
|
|
content => template("buildsystem/repsys.conf") |
85 |
|
|
} |
86 |
blino |
502 |
|
87 |
|
|
file { "$sched_home_dir/repsys": |
88 |
|
|
ensure => "directory", |
89 |
blino |
508 |
owner => $sched_login, |
90 |
blino |
502 |
require => File[$sched_home_dir], |
91 |
|
|
} |
92 |
|
|
|
93 |
|
|
file { "$sched_home_dir/repsys/tmp": |
94 |
|
|
ensure => "directory", |
95 |
blino |
508 |
owner => $sched_login, |
96 |
boklm |
512 |
group => "mga-packagers", |
97 |
boklm |
510 |
mode => 1775, |
98 |
blino |
502 |
require => File["$sched_home_dir/repsys"], |
99 |
|
|
} |
100 |
|
|
|
101 |
|
|
file { "$sched_home_dir/repsys/srpms": |
102 |
|
|
ensure => "directory", |
103 |
blino |
508 |
owner => $sched_login, |
104 |
boklm |
512 |
group => "mga-packagers", |
105 |
boklm |
510 |
mode => 1775, |
106 |
blino |
502 |
require => File["$sched_home_dir/repsys"], |
107 |
|
|
} |
108 |
misc |
265 |
} |
109 |
|
|
|
110 |
blino |
516 |
class youri_submit { |
111 |
boklm |
522 |
include sudo |
112 |
|
|
|
113 |
blino |
516 |
file { "/usr/local/bin/mdv-youri-submit": |
114 |
|
|
owner => root, |
115 |
|
|
group => root, |
116 |
|
|
mode => 755, |
117 |
|
|
content => template("buildsystem/mdv-youri-submit") |
118 |
|
|
} |
119 |
|
|
|
120 |
|
|
file { "/usr/local/bin/mdv-youri-submit.wrapper": |
121 |
|
|
owner => root, |
122 |
|
|
group => root, |
123 |
|
|
mode => 755, |
124 |
|
|
content => template("buildsystem/mdv-youri-submit.wrapper") |
125 |
|
|
} |
126 |
|
|
|
127 |
|
|
file { "/etc/sudoers.d/mdv-youri-submit": |
128 |
|
|
owner => root, |
129 |
|
|
group => root, |
130 |
|
|
mode => 440, |
131 |
|
|
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 |
blino |
516 |
} |
145 |
|
|
|
146 |
blino |
394 |
define sshuser($homedir, $comment) { |
147 |
|
|
group {"$title": |
148 |
blino |
351 |
ensure => present, |
149 |
|
|
} |
150 |
|
|
|
151 |
blino |
394 |
user {"$title": |
152 |
blino |
351 |
ensure => present, |
153 |
blino |
393 |
comment => $comment, |
154 |
blino |
351 |
managehome => true, |
155 |
blino |
394 |
gid => $title, |
156 |
blino |
351 |
shell => "/bin/bash", |
157 |
blino |
394 |
notify => Exec["unlock$title"], |
158 |
blino |
424 |
require => Group[$title], |
159 |
blino |
351 |
} |
160 |
blino |
372 |
|
161 |
blino |
386 |
# set password to * to unlock the account but forbid login through login |
162 |
blino |
394 |
exec { "unlock$title": |
163 |
|
|
command => "usermod -p '*' $title", |
164 |
blino |
386 |
refreshonly => true, |
165 |
|
|
} |
166 |
|
|
|
167 |
blino |
393 |
file { $homedir: |
168 |
blino |
383 |
ensure => "directory", |
169 |
blino |
423 |
require => User[$title], |
170 |
blino |
383 |
} |
171 |
|
|
|
172 |
blino |
393 |
file { "$homedir/.ssh": |
173 |
blino |
372 |
ensure => "directory", |
174 |
|
|
mode => 600, |
175 |
blino |
394 |
owner => $title, |
176 |
|
|
group => $title, |
177 |
blino |
423 |
require => File[$homedir], |
178 |
blino |
372 |
} |
179 |
blino |
351 |
} |
180 |
|
|
|
181 |
blino |
393 |
class iurtuser { |
182 |
blino |
394 |
sshuser { $build_login: |
183 |
|
|
homedir => $build_home_dir, |
184 |
|
|
comment => "System user used to run build bots", |
185 |
|
|
} |
186 |
blino |
429 |
|
187 |
|
|
file { "/etc/iurt": |
188 |
|
|
ensure => "directory", |
189 |
|
|
} |
190 |
blino |
393 |
} |
191 |
|
|
|
192 |
misc |
213 |
class iurt { |
193 |
boklm |
216 |
include sudo |
194 |
blino |
381 |
include iurtuser |
195 |
blino |
366 |
ssh::auth::client { $build_login: } |
196 |
blino |
396 |
ssh::auth::server { $sched_login: user => $build_login } |
197 |
misc |
213 |
|
198 |
|
|
# build node common settings |
199 |
|
|
# we could have the following skip list to use less space: |
200 |
|
|
# '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/' |
201 |
|
|
$package_list = ['task-bs-cluster-chroot', 'iurt'] |
202 |
|
|
package { $package_list: |
203 |
|
|
ensure => installed; |
204 |
|
|
} |
205 |
|
|
|
206 |
blino |
426 |
file { "/etc/iurt/build": |
207 |
|
|
ensure => "directory", |
208 |
blino |
428 |
require => File["/etc/iurt"], |
209 |
blino |
426 |
} |
210 |
|
|
|
211 |
blino |
425 |
file { "/etc/iurt/build/cauldron.conf": |
212 |
misc |
213 |
ensure => present, |
213 |
|
|
owner => $build_login, |
214 |
|
|
group => $build_login, |
215 |
|
|
mode => 644, |
216 |
blino |
426 |
require => File["/etc/iurt/build"], |
217 |
boklm |
218 |
content => template("buildsystem/iurt.cauldron.conf") |
218 |
misc |
213 |
} |
219 |
|
|
|
220 |
boklm |
216 |
file { "/etc/sudoers.d/iurt": |
221 |
|
|
ensure => present, |
222 |
|
|
owner => root, |
223 |
|
|
group => root, |
224 |
boklm |
219 |
mode => 440, |
225 |
boklm |
218 |
content => template("buildsystem/sudoers.iurt") |
226 |
boklm |
216 |
} |
227 |
dmorgan |
86 |
} |
228 |
|
|
} |