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