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