Load named::geodns from roles/manifests/init.pp based on hiera instead of from site...
[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         }
22
23         # XXX: turn this into a real role
24         if getfromhash($site::nodeinfo, 'buildd') {
25                 include buildd
26         }
27
28         # XXX: turn this into a real role
29         if getfromhash($site::nodeinfo, 'porterbox') {
30                 include porterbox
31         }
32
33         if has_role('bugs_mirror') {
34                 include roles::bugs_mirror
35         }
36
37         if has_role('bugs_base') {
38                 ssl::service { 'bugs.debian.org':
39                         notify  => Exec['service apache2 reload'],
40                         key => true,
41                 }
42                 @ferm::rule { 'dsa-bugs-abusers':
43                         prio    => "005",
44                         rule    => "saddr (220.243.135/24 220.243.136/24) DROP",
45                 }
46         }
47         if has_role('bugs_master') {
48                 ssl::service { 'bugs-devel.debian.org': notify  => Exec['service apache2 reload'], key => true, }
49                 ssl::service { 'bugs-master.debian.org': notify  => Exec['service apache2 reload'], key => true, }
50         }
51
52         if has_role('manpages-dyn') {
53                 include roles::manpages_dyn
54         }
55
56         if has_role('archvsync_base_additional') {
57                 include archvsync_base
58         }
59
60         # archive.debian.org
61         if has_role('historical_mirror') {
62                 include roles::historical_mirror
63         }
64
65         # debug archive
66         if has_role('debug_mirror') {
67                 include roles::debug_mirror
68         }
69
70         # ftp.debian.org and its ecosystem
71         if has_role('debian_mirror') {
72                 include roles::debian_mirror
73         }
74         if has_role('ftp_master') {
75                 include roles::ftp_master
76                 include roles::dakmaster
77                 include roles::signing
78         }
79         if has_role('ftp.upload.d.o') {
80                 include roles::ftp_upload
81         }
82         if has_role('ssh.upload.d.o') {
83                 include roles::ssh_upload
84         }
85         if has_role('security_upload') {
86                 include roles::security_upload
87         }
88         if has_role('api.ftp-master') {
89                 ssl::service { 'api.ftp-master.debian.org':
90                         notify  => Exec['service apache2 reload'],
91                         key => true,
92                 }
93         }
94         #
95         # security.debian.org
96         if has_role('security_master') {
97                 include roles::security_master
98                 include roles::dakmaster
99         }
100
101         if has_role('security_mirror') {
102                 include roles::security_mirror
103         }
104
105         if has_role('git_master') {
106                 include roles::git_master
107         }
108
109         if has_role('people') {
110                 ssl::service { 'people.debian.org': notify  => Exec['service apache2 reload'], key => true, }
111                 onion::service { 'people.debian.org': port => 80, target_address => 'people.debian.org', target_port => 80, direct => true }
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': notify  => Exec['service apache2 reload'], key => true, }
120         }
121
122         if has_role('keyring') {
123                 include roles::keyring
124         }
125
126         if has_role('wiki') {
127                 include roles::wiki
128         }
129
130         if has_role('syncproxy') {
131                 include roles::syncproxy
132         }
133
134         if has_role('static_master') {
135                 include roles::static_master
136         }
137
138         if has_role('static_mirror') {
139                 include roles::static_mirror
140         } elsif has_role('static_source') {
141                 include roles::static_source
142         }
143
144         if has_role('weblog_provider') {
145                 include roles::weblog_provider
146         }
147
148         if has_role('mailrelay') {
149                 include roles::mailrelay
150         }
151
152         if has_role('pubsub') {
153                 include roles::pubsub
154         }
155
156         if has_role('dbmaster') {
157                 include roles::dbmaster
158         }
159
160         if has_role('dns_primary') {
161                 include named::primary
162         }
163
164         if has_role('dns_geo') {
165                 include named::geodns
166         }
167
168         if has_role('weblog_destination') {
169                 include roles::weblog_destination
170         }
171
172         if has_role('vote') {
173                 include roles::vote
174         }
175
176         if has_role('security_tracker') {
177                 include roles::security_tracker
178         }
179
180         if has_role('lists') {
181                 include roles::lists
182         }
183
184         if has_role('rtmaster') {
185                 include roles::rtmaster
186         }
187
188         if has_role('udd') {
189                 include roles::udd
190         }
191
192         if has_role('sso') {
193                 include roles::sso
194         }
195
196         if has_role('sso_rp') {
197                 include roles::sso_rp
198         }
199
200         if has_role('tracker') {
201                 include roles::tracker
202         }
203
204         if has_role('buildd_master') {
205                 include roles::buildd_master
206         }
207
208         if has_role('piuparts') {
209                 include roles::piuparts
210         }
211         if has_role('piuparts_slave') {
212                 include roles::piuparts_slave
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('rtc') {
224                 include roles::rtc
225         }
226
227         if has_role('jenkins') {
228                 include roles::jenkins
229         }
230
231         if has_role('postgres_backup_server') {
232                 include postgres::backup_server
233         }
234
235         if has_role('packages') {
236                 ssl::service { 'packages.debian.org': notify  => Exec['service apache2 reload'], key => true, }
237         }
238
239         if has_role('historicalpackages') {
240                 ssl::service { 'historical.packages.debian.org': notify  => Exec['service apache2 reload'], key => true, }
241         }
242
243         if has_role('qamaster') {
244                 ssl::service { 'qa.debian.org': notify  => Exec['service apache2 reload'], key => true, }
245         }
246
247         if has_role('packagesqamaster') {
248                 ssl::service { 'packages.qa.debian.org': notify  => Exec['service apache2 reload'], key => true, }
249         }
250
251         if has_role('gobby_debian_org') {
252                 ssl::service { 'gobby.debian.org':
253                         notify  => [ Exec['service apache2 reload'], Exec['reload gobby'] ],
254                         key => true,
255                         tlsaport => [443, 6523],
256                 }
257                 file { '/etc/ssl/debian-local/other-keys/gobby.debian.org.key':
258                         ensure => present,
259                         mode => '0440',
260                         group => 'gobby',
261                         content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.letsencrypt_dir"]) + "/gobby.debian.org.key") %>'),
262                         links => follow,
263                         notify => Exec['reload gobby'],
264                 }
265                 exec { 'reload gobby':
266                         command => 'pkill -u gobby -HUP -x infinoted',
267                         refreshonly => true,
268                 }
269         }
270
271         if has_role('search_backend') {
272                 include roles::search_backend
273         }
274         if has_role('search_frontend') {
275                 include roles::search_frontend
276         }
277
278         if has_role('dgit_browse') {
279                 include roles::dgit_browse
280         }
281         if has_role('dgit_git') {
282                 include roles::dgit_git
283         }
284
285         if $::hostname in [lw01, lw02, lw03, lw04, lw09, lw10] {
286                 include roles::snapshot
287         }
288
289         if has_role('snapshot_web') {
290                 include roles::snapshot_web
291         }
292
293         if has_role('snapshot_shell') {
294                 include roles::snapshot_shell
295         }
296
297         if has_role('veyepar.debian.org') {
298                 ssl::service { 'veyepar.debian.org': notify  => Exec['service apache2 reload'], key => true, }
299         }
300         if has_role('sreview.debian.org') {
301                 ssl::service { 'sreview.debian.net': notify  => Exec['service apache2 reload'], key => true, }
302         }
303
304         if has_role('debtags') {
305                 include roles::debtags
306         }
307
308         if has_role('planet_master') {
309                 include roles::planet_master
310         }
311         if has_role('planet_search') {
312                 ssl::service { 'planet-search.debian.org': notify  => Exec['service apache2 reload'], key => true, }
313         }
314
315         if has_role('i18n.d.o') {
316                 ssl::service { 'i18n.debian.org': notify  => Exec['service apache2 reload'], key => true, }
317         }
318
319         if has_role('l10n.d.o') {
320                 ssl::service { 'l10n.debian.org': notify  => Exec['service apache2 reload'], key => true, }
321         }
322
323         if has_role('dedup.d.n') {
324                 ssl::service { 'dedup.debian.net': notify  => Exec['service apache2 reload'], key => true, }
325         }
326
327         if has_role('pet.d.n') {
328                 ssl::service { 'pet.debian.net': notify  => Exec['service apache2 reload'], key => true, }
329                 ssl::service { 'pet-devel.debian.net': notify  => Exec['service apache2 reload'], key => true, }
330         }
331
332         if has_role('ports_master') {
333                 include roles::ports_master
334         }
335         if has_role('ports_mirror') {
336                 include roles::ports_mirror
337         }
338
339         if has_role('onionbalance') {
340                 include onion::balance
341         }
342         if has_role('bgp') {
343                 include roles::bgp
344         }
345         if has_role('cdimage-search') {
346                 include roles::cdimage_search
347         }
348
349         if has_role('postgresql_server') {
350                 include postgres::backup_source
351         }
352
353         if has_role('bacula_director') {
354                 include bacula::director
355         } else {
356                 package { 'bacula-console': ensure => purged; }
357                 file { '/etc/bacula/bconsole.conf': ensure => absent; }
358         }
359         if has_role('bacula_storage') {
360                 include bacula::storage
361         }
362
363         if has_role('salsa.debian.org') {
364                 include salsa
365         }
366
367         if $::keyring_debian_org_mirror {
368                 include roles::keyring_debian_org_mirror
369         }
370
371         if has_role('popcon') {
372                 include roles::popcon
373         }
374
375         if has_role('debsources') {
376                 include roles::debsources
377         }
378
379         if has_role('ipsec') {
380                 include ipsec
381         }
382
383         if has_role('debconf_wafer') {
384                 include roles::debconf_wafer
385         }
386
387         if has_role('cdbuilder_local_mirror') {
388                 include roles::cdbuilder_local_mirror
389         }
390
391         if has_role('alioth_archive') {
392                 include roles::alioth_archive
393         }
394         if has_role('anonscm') {
395                 include roles::anonscm
396         }
397
398 }