no longer require manual configuration of all onionbalancers
[mirror/dsa-puppet.git] / modules / roles / manifests / init.pp
1 # = Class: roles
2 #
3 # Lookup role and include relevant classes for roles
4 #
5 # == Sample Usage:
6 #
7 #   include roles
8 #
9 class roles {
10
11         if has_role('puppetmaster') {
12                 include puppetmaster
13         }
14
15         if has_role('muninmaster') {
16                 include munin::master
17         }
18
19         if has_role('nagiosmaster') {
20         #       include nagios::server
21                 ssl::service { 'nagios.debian.org':
22                         notify => Service['apache2'],
23                 }
24         }
25
26         # XXX: turn this into a real role
27         if getfromhash($site::nodeinfo, 'buildd') {
28                 include buildd
29         }
30
31         # XXX: turn this into a real role
32         if getfromhash($site::nodeinfo, 'porterbox') {
33                 include porterbox
34         }
35
36         if has_role('archive_master') {
37                 include archive_master
38         }
39
40         if has_role('bugs_mirror') {
41                 include roles::bugs_mirror
42         }
43
44         if has_role('bugs_base') {
45                 ssl::service { 'bugs.debian.org':
46                         notify => Service['apache2'],
47                 }
48         }
49         if has_role('bugs_master') {
50                 ssl::service { 'bugs-master.debian.org':
51                         notify => Service['apache2'],
52                         key => true,
53                 }
54         }
55
56         if has_role('ftp_master') {
57                 include roles::ftp_master
58                 include roles::dakmaster
59         }
60
61         if has_role('api.ftp-master') {
62                 ssl::service { 'api.ftp-master.debian.org':
63                         notify => Service['apache2'],
64                 }
65         }
66
67         if has_role('manpages') {
68                 ssl::service { 'manpages.debian.org':
69                         notify => Service['apache2'],
70                         key => true,
71                 }
72         }
73
74         if has_role('security_mirror') {
75                 include roles::security_mirror
76         }
77         if has_role('debug_mirror') {
78                 include roles::debug_mirror
79         }
80
81         if has_role('ftp.d.o') {
82                 include roles::ftp
83         }
84
85         if has_role('ftp.upload.d.o') {
86                 include roles::ftp_upload
87         }
88
89         if has_role('ssh.upload.d.o') {
90                 include roles::ssh_upload
91         }
92
93         if has_role('git_master') {
94                 include roles::git_master
95         }
96
97         if has_role('people') {
98                 ssl::service { 'people.debian.org':
99                         notify => Service['apache2'],
100                         key => true,
101                 }
102         }
103
104         if has_role('security_master') {
105                 include roles::security_master
106                 include roles::dakmaster
107         }
108
109         if has_role('www_master') {
110                 include roles::www_master
111         }
112
113         if has_role('cgi.d.o') {
114                 ssl::service { 'cgi.debian.org':
115                         notify => Service['apache2'],
116                         key => true,
117                 }
118         }
119
120         if has_role('keyring') {
121                 include roles::keyring
122         }
123
124         if has_role('wiki') {
125                 include roles::wiki
126         }
127
128         if has_role('syncproxy') {
129                 include roles::syncproxy
130         }
131
132         if has_role('static_master') {
133                 include roles::static_master
134         }
135
136         if has_role('static_mirror') {
137                 include roles::static_mirror
138         } elsif has_role('static_source') {
139                 include roles::static_source
140         }
141
142         if has_role('weblog_provider') {
143                 include roles::weblog_provider
144         }
145
146         if has_role('mailrelay') {
147                 include roles::mailrelay
148         }
149
150         if has_role('pubsub') {
151                 include roles::pubsub
152         }
153
154         if has_role('dbmaster') {
155                 include roles::dbmaster
156         }
157
158         if has_role('dns_primary') {
159                 include named::primary
160         }
161
162         if has_role('weblog_destination') {
163                 include roles::weblog_destination
164         }
165
166         if has_role('vote') {
167                 include roles::vote
168         }
169
170         if has_role('security_tracker') {
171                 include roles::security_tracker
172         }
173
174         if has_role('lists') {
175                 include roles::lists
176         }
177
178         if has_role('list_search') {
179                 include roles::listsearch
180         }
181
182         if has_role('rtmaster') {
183                 include roles::rtmaster
184         }
185
186         if has_role('udd') {
187                 include roles::udd
188         }
189
190         if has_role('sso') {
191                 include roles::sso
192         }
193
194         if has_role('sso_rp') {
195                 include roles::sso_rp
196         }
197
198         if has_role('tracker') {
199                 include roles::tracker
200         }
201
202         if has_role('buildd_master') {
203                 include roles::buildd_master
204         }
205
206         if has_role('piuparts') {
207                 include roles::piuparts
208         }
209
210         if has_role('contributors') {
211                 include roles::contributors
212         }
213
214         if has_role('nm') {
215                 include roles::nm
216         }
217
218         if has_role('release') {
219                 include roles::release
220         }
221
222         if has_role('rtc') {
223                 include roles::rtc
224         }
225
226         if has_role('jenkins') {
227                 include roles::jenkins
228         }
229
230         if has_role('keystone') {
231                 include roles::keystone
232         }
233         if has_role('keystone_rabbitmq') {
234                 include roles::keystone::rabbitmq
235         }
236
237         if has_role('memcached') {
238                 include roles::memcached
239         }
240
241         if has_role('postgres_backup_server') {
242                 include postgres::backup_server
243         }
244
245         if has_role('packages') {
246                 ssl::service { 'packages.debian.org':
247                         notify => Service['apache2'],
248                         key => true,
249                 }
250         }
251
252         if has_role('qamaster') {
253                 ssl::service { 'qa.debian.org':
254                         notify => Service['apache2'],
255                         key => true,
256                 }
257         }
258
259         if has_role('packagesqamaster') {
260                 ssl::service { 'packages.qa.debian.org':
261                         notify => Service['apache2'],
262                         key => true,
263                 }
264         }
265
266         if has_role('gobby_debian_org') {
267                 ssl::service { 'gobby.debian.org':
268                         notify => Service['apache2'],
269                         key => true,
270                         tlsaport => [443, 6523],
271                 }
272         }
273
274         if has_role('search_backend') {
275                 include search_backend
276         }
277         if has_role('search_frontend') {
278                 include search_frontend
279         }
280
281         if has_role('dgit_browse') {
282                 include dgit_browse
283         }
284         if has_role('dgit_git') {
285                 include dgit_git
286         }
287
288         if $::hostname in [lw01, lw02, lw03, lw04] {
289                 include snapshot
290         }
291
292         if has_role('veyepar.debian.org') {
293                 ssl::service { 'veyepar.debian.org':
294                         notify => Service['apache2'],
295                         key => true,
296                 }
297         }
298
299         if has_role('httpredir') {
300                 include roles::httpredir
301         }
302
303         if has_role('debtags') {
304                 include roles::debtags
305         }
306
307         if has_role('planet_search') {
308                 ssl::service { 'planet-search.debian.org':
309                         notify => Service['apache2'],
310                         key => true,
311                 }
312         }
313
314         if has_role('i18n.d.o') {
315                 ssl::service { 'i18n.debian.org':
316                         notify => Service['apache2'],
317                         key => true,
318                 }
319         }
320
321         if has_role('l10n.d.o') {
322                 ssl::service { 'l10n.debian.org':
323                         notify => Service['apache2'],
324                         key => true,
325                 }
326         }
327
328         if has_role('dedup.d.n') {
329                 ssl::service { 'dedup.debian.net':
330                         notify => Service['apache2'],
331                         key => true,
332                 }
333         }
334
335         if has_role('pet.d.n') {
336                 ssl::service { 'pet.debian.net':
337                         notify => Service['apache2'],
338                         key => true,
339                 }
340                 ssl::service { 'pet-devel.debian.net':
341                         notify => Service['apache2'],
342                         key => true,
343                 }
344         }
345
346         if has_role('ports-master') {
347                 include roles::ports-master
348         }
349         if has_role('ports_mirror') {
350                 include roles::ports_mirror
351         }
352
353         if $::hostname in [klecker] {
354                 onion::service { 'ftp.debian.org':
355                         port => 80,
356                         target_address => '130.89.148.12',
357                         target_port => 81,
358                 }
359         }
360         if has_role('onionbalance') {
361                 include onion::balance
362         }
363 }