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