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