/[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 502 - (show annotations) (download)
Sun Dec 5 22:38:01 2010 UTC (13 years, 4 months ago) by blino
File size: 4666 byte(s)
create /home/schedbot/repsys/{tmp,srpms}

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 }
42
43 class buildnode inherits base {
44 include iurt
45 }
46
47 class scheduler {
48 # ulri
49 include iurtupload
50 }
51
52 class gatherer {
53 # emi
54 include iurtupload
55 }
56
57 class iurtupload {
58 file { "/etc/iurt/upload.conf":
59 ensure => present,
60 owner => $build_login,
61 group => $build_login,
62 mode => 644,
63 require => File["/etc/iurt"],
64 content => template("buildsystem/upload.conf")
65 }
66 }
67
68 class repsys {
69 package { 'repsys':
70
71 }
72
73 file { "repsys.conf":
74 path => "/etc/repsys.conf",
75 owner => root,
76 group => root,
77 mode => 644,
78 content => template("buildsystem/repsys.conf")
79 }
80
81 file { "$sched_home_dir/repsys":
82 ensure => "directory",
83 require => File[$sched_home_dir],
84 }
85
86 file { "$sched_home_dir/repsys/tmp":
87 ensure => "directory",
88 require => File["$sched_home_dir/repsys"],
89 }
90
91 file { "$sched_home_dir/repsys/srpms":
92 ensure => "directory",
93 require => File["$sched_home_dir/repsys"],
94 }
95 }
96
97 define sshuser($homedir, $comment) {
98 group {"$title":
99 ensure => present,
100 }
101
102 user {"$title":
103 ensure => present,
104 comment => $comment,
105 managehome => true,
106 gid => $title,
107 shell => "/bin/bash",
108 notify => Exec["unlock$title"],
109 require => Group[$title],
110 }
111
112 # set password to * to unlock the account but forbid login through login
113 exec { "unlock$title":
114 command => "usermod -p '*' $title",
115 refreshonly => true,
116 }
117
118 file { $homedir:
119 ensure => "directory",
120 require => User[$title],
121 }
122
123 file { "$homedir/.ssh":
124 ensure => "directory",
125 mode => 600,
126 owner => $title,
127 group => $title,
128 require => File[$homedir],
129 }
130 }
131
132 class iurtuser {
133 sshuser { $build_login:
134 homedir => $build_home_dir,
135 comment => "System user used to run build bots",
136 }
137
138 file { "/etc/iurt":
139 ensure => "directory",
140 }
141 }
142
143 class iurt {
144 include sudo
145 include iurtuser
146 ssh::auth::client { $build_login: }
147 ssh::auth::server { $sched_login: user => $build_login }
148
149 # build node common settings
150 # we could have the following skip list to use less space:
151 # '/(drakx-installer-binaries|drakx-installer-advertising|gfxboot|drakx-installer-stage2|mandriva-theme)/'
152 $package_list = ['task-bs-cluster-chroot', 'iurt']
153 package { $package_list:
154 ensure => installed;
155 }
156
157 file { "/etc/iurt/build":
158 ensure => "directory",
159 require => File["/etc/iurt"],
160 }
161
162 file { "/etc/iurt/build/cauldron.conf":
163 ensure => present,
164 owner => $build_login,
165 group => $build_login,
166 mode => 644,
167 require => File["/etc/iurt/build"],
168 content => template("buildsystem/iurt.cauldron.conf")
169 }
170
171 file { "/etc/sudoers.d/iurt":
172 ensure => present,
173 owner => root,
174 group => root,
175 mode => 440,
176 content => template("buildsystem/sudoers.iurt")
177 }
178 }
179 }

  ViewVC Help
Powered by ViewVC 1.1.30