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