/[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 2325 - (show annotations) (download)
Sun Jan 22 20:15:40 2012 UTC (12 years, 2 months ago) by misc
File size: 6654 byte(s)
create /distrib/bootstrap, or bootstrapping BS fail
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 = "/var/lib/$sched_login"
8 $packages_archivedir = "$sched_home_dir/old"
9 $repository_root = "/distrib/bootstrap"
10 $packagers_group = 'mga-packagers'
11 $packagers_committers_group = 'mga-packagers-committers'
12
13 include ssh::auth
14 ssh::auth::key { $build_login: # declare a key for build bot: RSA, 2048 bits
15 home => $build_home_dir,
16 }
17 ssh::auth::key { $sched_login: # declare a key for sched bot: RSA, 2048 bits
18 home => $sched_home_dir,
19 }
20 }
21
22 class mainnode inherits base {
23 include iurtuser
24
25 sshuser { $sched_login:
26 homedir => $sched_home_dir,
27 comment => "System user used to schedule builds",
28 }
29
30 ssh::auth::client { $sched_login: }
31
32 ssh::auth::server { [$sched_login, $build_login]: }
33
34 # FIXME Add again task-bs-cluster-main when it will require mgarepo instead of repsys
35 $package_list = ['iurt']
36 package { $package_list: }
37
38 $mirror_root = "/distrib/mirror"
39 apache::vhost_other_app { "repository.$domain":
40 vhost_file => "buildsystem/vhost_repository.conf",
41 }
42
43 $location = "/var/www/bs"
44 file { ["$location","$location/data"]:
45 ensure => directory,
46 }
47
48 apache::vhost_base { "pkgsubmit.$domain":
49 aliases => { "/uploads" => "$sched_home_dir/uploads" },
50 location => $location,
51 content => template("buildsystem/vhost_pkgsubmit.conf"),
52 }
53
54 subversion::snapshot { $location:
55 source => "svn://svn.$domain/soft/buildsystem/web/",
56 }
57
58 file { "$repository_root":
59 ensure => directory,
60 }
61
62 define media_cfg() {
63 $arch = $name
64 file { "$repository_root/distrib/cauldron/$arch/media/media_info/media.cfg":
65 owner => $sched_login,
66 group => $sched_login,
67 source => "puppet:///modules/buildsystem/$arch/media.cfg",
68 }
69 }
70
71 media_cfg { ["i586","x86_64"]: }
72
73 include scheduler
74 include gatherer
75 include buildsystem::mgarepo
76 include buildsystem::signbot
77 include youri_submit
78 include buildsystem::check_missing_deps
79
80 cron { "dispatch jobs":
81 user => $sched_login,
82 command => "emi ; ulri",
83 minute => "*",
84 }
85 }
86
87 class buildnode inherits base {
88 include buildsystem::iurt
89 }
90
91 class scheduler {
92 # ulri
93 include iurtupload
94 }
95
96 class gatherer {
97 # emi
98 include iurtupload
99 }
100
101 class iurtupload {
102 file { "/etc/iurt/upload.conf":
103 require => File["/etc/iurt"],
104 content => template("buildsystem/upload.conf")
105 }
106 }
107
108 class youri_submit {
109 include sudo
110
111 local_script {
112 "mga-youri-submit": content => template("buildsystem/mga-youri-submit");
113 "mga-youri-submit.wrapper": content => template("buildsystem/mga-youri-submit.wrapper");
114 "submit_package": content => template('buildsystem/submit_package.pl');
115 }
116
117 sudo::sudoers_config { "mga-youri-submit":
118 content => template("buildsystem/sudoers.youri")
119 }
120
121 package { "rpmlint": }
122
123 file { "/etc/rpmlint/config":
124 require => Package['rpmlint'],
125 content => template("buildsystem/rpmlint.conf")
126 }
127
128 # directory that hold configuration auto extracted after upload
129 # of the rpmlint policy
130 file { "/etc/rpmlint/extracted.d/":
131 ensure => directory,
132 require => Package['rpmlint'],
133 owner => $sched_login,
134 }
135
136 # ordering is automatic :
137 # http://docs.puppetlabs.com/learning/ordering.html#autorequire
138 file { "/etc/youri":
139 ensure => "directory",
140 }
141
142 file {
143 "/etc/youri/submit-todo.conf": content => template("buildsystem/submit-todo.conf");
144 "/etc/youri/submit-upload.conf": content => template("buildsystem/submit-upload.conf");
145 "/etc/youri/acl.conf": content => template("buildsystem/youri_acl.conf");
146 }
147
148 # FIXME use the correct perl directory
149 file { "/usr/lib/perl5/site_perl/5.10.1/Youri/Repository":
150 ensure => "directory",
151 }
152
153 file { '/usr/lib/perl5/site_perl/5.10.1/Youri/Repository/Mageia.pm':
154 source => "puppet:///modules/buildsystem/Mageia.pm",
155 }
156
157 $package_list = ['perl-SVN', 'mdv-distrib-tools', 'perl-Youri-Media',
158 'perl-Youri-Package', 'perl-Youri-Repository',
159 'perl-Youri-Utils', 'perl-Youri-Config', 'mga-youri-submit']
160
161 package { $package_list: }
162 }
163
164 # $groups: array of secondary groups (only local groups, no ldap)
165 define sshuser($homedir, $comment, $groups = []) {
166 group {"$title":
167 ensure => present,
168 }
169
170 user {"$title":
171 ensure => present,
172 comment => $comment,
173 managehome => true,
174 home => $homedir,
175 gid => $title,
176 groups => $groups,
177 shell => "/bin/bash",
178 notify => Exec["unlock$title"],
179 require => Group[$title],
180 }
181
182 # set password to * to unlock the account but forbid login through login
183 exec { "unlock$title":
184 command => "usermod -p '*' $title",
185 refreshonly => true,
186 }
187
188 file { $homedir:
189 ensure => "directory",
190 owner => $title,
191 group => $title,
192 require => User[$title],
193 }
194
195 file { "$homedir/.ssh":
196 ensure => "directory",
197 mode => 600,
198 owner => $title,
199 group => $title,
200 require => File[$homedir],
201 }
202 }
203
204 class iurtuser {
205 sshuser { $build_login:
206 homedir => $build_home_dir,
207 comment => "System user used to run build bots",
208 }
209
210 file { "/etc/iurt":
211 ensure => "directory",
212 }
213 }
214
215 # A script to copy on valstar the 2010.1 rpms built on jonund
216 class sync20101 inherits base {
217 local_script { "sync2010.1":
218 content => template("buildsystem/sync2010.1"),
219 }
220 }
221
222 # a script to build 2010.1 packages. used on jonund
223 class iurt20101 inherits base {
224 local_script { "iurt2010.1":
225 content => template("buildsystem/iurt2010.1"),
226 }
227 }
228 }

  ViewVC Help
Powered by ViewVC 1.1.30