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