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