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 |
393 |
$sched_login = "schedbot" |
7 |
|
|
$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 |
boklm |
356 |
} |
12 |
boklm |
355 |
|
13 |
boklm |
356 |
class mainnode inherits base { |
14 |
blino |
381 |
include iurtuser |
15 |
blino |
366 |
ssh::auth::server { $build_login: } |
16 |
blino |
353 |
|
17 |
blino |
350 |
package { "task-bs-cluster-main": |
18 |
|
|
ensure => "installed" |
19 |
|
|
} |
20 |
|
|
} |
21 |
|
|
|
22 |
boklm |
356 |
class buildnode inherits base { |
23 |
misc |
213 |
include iurt |
24 |
dmorgan |
86 |
} |
25 |
|
|
|
26 |
misc |
265 |
class scheduler { |
27 |
|
|
# ulri |
28 |
|
|
} |
29 |
|
|
|
30 |
|
|
class dispatcher { |
31 |
|
|
# emi |
32 |
|
|
} |
33 |
|
|
|
34 |
|
|
class repsys { |
35 |
|
|
package { 'repsys': |
36 |
|
|
|
37 |
|
|
} |
38 |
|
|
|
39 |
|
|
|
40 |
|
|
} |
41 |
|
|
|
42 |
blino |
393 |
define sshuser($user, $homedir, $comment) { |
43 |
|
|
group {"$user": |
44 |
blino |
351 |
ensure => present, |
45 |
|
|
} |
46 |
|
|
|
47 |
blino |
393 |
user {"$user": |
48 |
blino |
351 |
ensure => present, |
49 |
blino |
393 |
comment => $comment, |
50 |
blino |
351 |
managehome => true, |
51 |
blino |
393 |
gid => $user, |
52 |
blino |
351 |
shell => "/bin/bash", |
53 |
blino |
393 |
notify => Exec["unlock$user"], |
54 |
blino |
351 |
} |
55 |
blino |
372 |
|
56 |
blino |
386 |
# set password to * to unlock the account but forbid login through login |
57 |
blino |
393 |
exec { "unlock$user": |
58 |
|
|
command => "usermod -p '*' $user", |
59 |
blino |
386 |
refreshonly => true, |
60 |
|
|
} |
61 |
|
|
|
62 |
blino |
393 |
file { $homedir: |
63 |
blino |
383 |
ensure => "directory", |
64 |
|
|
} |
65 |
|
|
|
66 |
blino |
393 |
file { "$homedir/.ssh": |
67 |
blino |
372 |
ensure => "directory", |
68 |
|
|
mode => 600, |
69 |
blino |
393 |
owner => $user, |
70 |
|
|
group => $user, |
71 |
blino |
372 |
} |
72 |
blino |
351 |
} |
73 |
|
|
|
74 |
blino |
393 |
class iurtuser { |
75 |
|
|
sshuser($build_login, $build_home_dir, "System user used to run build bots") |
76 |
|
|
} |
77 |
|
|
|
78 |
misc |
213 |
class iurt { |
79 |
boklm |
216 |
include sudo |
80 |
blino |
381 |
include iurtuser |
81 |
blino |
366 |
ssh::auth::client { $build_login: } |
82 |
misc |
213 |
|
83 |
|
|
# build node common settings |
84 |
|
|
# we could have the following skip list to use less space: |
85 |
|
|
# '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/' |
86 |
|
|
$package_list = ['task-bs-cluster-chroot', 'iurt'] |
87 |
|
|
package { $package_list: |
88 |
|
|
ensure => installed; |
89 |
|
|
} |
90 |
|
|
|
91 |
blino |
351 |
file { "$build_home_dir/.iurt.cauldron.conf": |
92 |
misc |
213 |
ensure => present, |
93 |
|
|
owner => $build_login, |
94 |
|
|
group => $build_login, |
95 |
|
|
mode => 644, |
96 |
boklm |
218 |
content => template("buildsystem/iurt.cauldron.conf") |
97 |
misc |
213 |
} |
98 |
|
|
|
99 |
boklm |
216 |
file { "/etc/sudoers.d/iurt": |
100 |
|
|
ensure => present, |
101 |
|
|
owner => root, |
102 |
|
|
group => root, |
103 |
boklm |
219 |
mode => 440, |
104 |
boklm |
218 |
content => template("buildsystem/sudoers.iurt") |
105 |
boklm |
216 |
} |
106 |
dmorgan |
86 |
} |
107 |
|
|
} |