/[adm]/puppet/modules/buildsystem/manifests/init.pp
ViewVC logotype

Contents of /puppet/modules/buildsystem/manifests/init.pp

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.28