and onionbalance module
[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         # XXX: turn this into a real role
75         if getfromhash($site::nodeinfo, 'apache2_security_mirror') {
76                 include roles::security_mirror
77         }
78
79         if has_role('mirror_debug') {
80                 include roles::debug_mirror
81         }
82         if has_role('mirror_ports') {
83                 include roles::ports_mirror
84         }
85
86         if has_role('ftp.d.o') {
87                 include roles::ftp
88         }
89
90         if has_role('ftp.upload.d.o') {
91                 include roles::ftp_upload
92         }
93
94         if has_role('ssh.upload.d.o') {
95                 include roles::ssh_upload
96         }
97
98         if has_role('git_master') {
99                 include roles::git_master
100         }
101
102         if has_role('people') {
103                 ssl::service { 'people.debian.org':
104                         notify => Service['apache2'],
105                         key => true,
106                 }
107         }
108
109         if has_role('security_master') {
110                 include roles::security_master
111                 include roles::dakmaster
112         }
113
114         if has_role('www_master') {
115                 include roles::www_master
116         }
117
118         if has_role('cgi.d.o') {
119                 ssl::service { 'cgi.debian.org':
120                         notify => Service['apache2'],
121                         key => true,
122                 }
123         }
124
125         if has_role('keyring') {
126                 include roles::keyring
127         }
128
129         if has_role('wiki') {
130                 include roles::wiki
131         }
132
133         if has_role('syncproxy') {
134                 include roles::syncproxy
135         }
136
137         if has_role('static_master') {
138                 include roles::static_master
139         }
140
141         if has_role('static_mirror') {
142                 include roles::static_mirror
143         } elsif has_role('static_source') {
144                 include roles::static_source
145         }
146
147         if has_role('weblog_provider') {
148                 include roles::weblog_provider
149         }
150
151         if has_role('mailrelay') {
152                 include roles::mailrelay
153         }
154
155         if has_role('pubsub') {
156                 include roles::pubsub
157         }
158
159         if has_role('dbmaster') {
160                 include roles::dbmaster
161         }
162
163         if has_role('dns_primary') {
164                 include named::primary
165         }
166
167         if has_role('weblog_destination') {
168                 include roles::weblog_destination
169         }
170
171         if has_role('vote') {
172                 include roles::vote
173         }
174
175         if has_role('security_tracker') {
176                 include roles::security_tracker
177         }
178
179         if has_role('lists') {
180                 include roles::lists
181         }
182
183         if has_role('list_search') {
184                 include roles::listsearch
185         }
186
187         if has_role('rtmaster') {
188                 include roles::rtmaster
189         }
190
191         if has_role('udd') {
192                 include roles::udd
193         }
194
195         if has_role('sso') {
196                 include roles::sso
197         }
198
199         if has_role('sso_rp') {
200                 include roles::sso_rp
201         }
202
203         if has_role('tracker') {
204                 include roles::tracker
205         }
206
207         if has_role('buildd_master') {
208                 include roles::buildd_master
209         }
210
211         if has_role('piuparts') {
212                 include roles::piuparts
213         }
214
215         if has_role('contributors') {
216                 include roles::contributors
217         }
218
219         if has_role('nm') {
220                 include roles::nm
221         }
222
223         if has_role('release') {
224                 include roles::release
225         }
226
227         if has_role('rtc') {
228                 include roles::rtc
229         }
230
231         if has_role('jenkins') {
232                 include roles::jenkins
233         }
234
235         if has_role('keystone') {
236                 include roles::keystone
237         }
238         if has_role('keystone_rabbitmq') {
239                 include roles::keystone::rabbitmq
240         }
241
242         if has_role('memcached') {
243                 include roles::memcached
244         }
245
246         if has_role('postgres_backup_server') {
247                 include postgres::backup_server
248         }
249
250         if has_role('packages') {
251                 ssl::service { 'packages.debian.org':
252                         notify => Service['apache2'],
253                         key => true,
254                 }
255         }
256
257         if has_role('qamaster') {
258                 ssl::service { 'qa.debian.org':
259                         notify => Service['apache2'],
260                         key => true,
261                 }
262         }
263
264         if has_role('packagesqamaster') {
265                 ssl::service { 'packages.qa.debian.org':
266                         notify => Service['apache2'],
267                         key => true,
268                 }
269         }
270
271         if has_role('gobby_debian_org') {
272                 ssl::service { 'gobby.debian.org':
273                         notify => Service['apache2'],
274                         key => true,
275                         tlsaport => [443, 6523],
276                 }
277         }
278
279         if has_role('search_backend') {
280                 include search_backend
281         }
282         if has_role('search_frontend') {
283                 include search_frontend
284         }
285
286         if has_role('dgit_browse') {
287                 include dgit_browse
288         }
289         if has_role('dgit_git') {
290                 include dgit_git
291         }
292
293         if $::hostname in [lw01, lw02, lw03, lw04] {
294                 include snapshot
295         }
296
297         if has_role('veyepar.debian.org') {
298                 ssl::service { 'veyepar.debian.org':
299                         notify => Service['apache2'],
300                         key => true,
301                 }
302         }
303
304         if has_role('httpredir') {
305                 include roles::httpredir
306         }
307
308         if has_role('debtags') {
309                 include roles::debtags
310         }
311
312         if has_role('planet_search') {
313                 ssl::service { 'planet-search.debian.org':
314                         notify => Service['apache2'],
315                         key => true,
316                 }
317         }
318
319         if has_role('i18n.d.o') {
320                 ssl::service { 'i18n.debian.org':
321                         notify => Service['apache2'],
322                         key => true,
323                 }
324         }
325
326         if has_role('l10n.d.o') {
327                 ssl::service { 'l10n.debian.org':
328                         notify => Service['apache2'],
329                         key => true,
330                 }
331         }
332
333         if has_role('dedup.d.n') {
334                 ssl::service { 'dedup.debian.net':
335                         notify => Service['apache2'],
336                         key => true,
337                 }
338         }
339
340         if has_role('pet.d.n') {
341                 ssl::service { 'pet.debian.net':
342                         notify => Service['apache2'],
343                         key => true,
344                 }
345                 ssl::service { 'pet-devel.debian.net':
346                         notify => Service['apache2'],
347                         key => true,
348                 }
349         }
350
351         if has_role('ports-master') {
352                 include roles::ports-master
353         }
354
355         if $::hostname in [klecker] {
356                 onion::service { 'ftp.debian.org':
357                         port => 80,
358                         target_address => '130.89.148.12',
359                         target_port => 81,
360                 }
361         }
362         if $::hostname in [olin] {
363                 onion::balance_service { 'ftp.debian.org': }
364         }
365 }