people -> hiera role; explicitly include apache2
[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('manpages-dyn') {
19                 include roles::manpages_dyn
20         }
21
22         # archive.debian.org
23         if has_role('historical_mirror') {
24                 include roles::historical_mirror
25         }
26
27         # debug archive
28         if has_role('debug_mirror') {
29                 include roles::debug_mirror
30         }
31
32         # ftp.debian.org and its ecosystem
33         if has_role('debian_mirror') {
34                 include roles::debian_mirror
35         }
36         if has_role('ftp_master') {
37                 include roles::ftp_master
38                 include roles::dakmaster
39                 include roles::signing
40         }
41         if has_role('ftp.upload.d.o') {
42                 include roles::ftp_upload
43         }
44         if has_role('ssh.upload.d.o') {
45                 include roles::ssh_upload
46         }
47         if has_role('security_upload') {
48                 include roles::security_upload
49         }
50         #
51         # security.debian.org
52         if has_role('security_master') {
53                 include roles::security_master
54                 include roles::dakmaster
55         }
56
57         if has_role('security_mirror') {
58                 include roles::security_mirror
59         }
60
61         if has_role('git_master') {
62                 include roles::git_master
63         }
64
65         if has_role('www_master') {
66                 include roles::www_master
67         }
68
69         if has_role('cgi.d.o') {
70                 ssl::service { 'cgi.debian.org': notify  => Exec['service apache2 reload'], key => true, }
71         }
72
73         if has_role('wiki') {
74                 include roles::wiki
75         }
76
77         if has_role('syncproxy') {
78                 include roles::syncproxy
79         }
80
81         if has_role('mailrelay') {
82                 include roles::mailrelay
83         }
84
85         if has_role('pubsub') {
86                 include roles::pubsub
87         }
88
89         if has_role('dns_primary') {
90                 include roles::dns_primary
91         }
92
93         if has_role('dns_geo') {
94                 include roles::dns_geodns
95         }
96
97         if has_role('security_tracker') {
98                 include roles::security_tracker
99         }
100
101         if has_role('rtmaster') {
102                 include roles::rtmaster
103         }
104
105         if has_role('udd') {
106                 include roles::udd
107         }
108
109         if has_role('sso') {
110                 include roles::sso
111         }
112
113         if has_role('sso_rp') {
114                 include roles::sso_rp
115         }
116
117         if has_role('postgres_backup_server') {
118                 include postgres::backup_server
119         }
120
121         if has_role('packages') {
122                 ssl::service { 'packages.debian.org': notify  => Exec['service apache2 reload'], key => true, }
123         }
124
125         if has_role('historicalpackages') {
126                 ssl::service { 'historical.packages.debian.org': notify  => Exec['service apache2 reload'], key => true, }
127         }
128
129         if has_role('qamaster') {
130                 ssl::service { 'qa.debian.org': notify  => Exec['service apache2 reload'], key => true, }
131         }
132
133         if has_role('packagesqamaster') {
134                 ssl::service { 'packages.qa.debian.org': notify  => Exec['service apache2 reload'], key => true, }
135         }
136
137         if has_role('gobby_debian_org') {
138                 ssl::service { 'gobby.debian.org':
139                         notify  => [ Exec['service apache2 reload'], Exec['reload gobby'] ],
140                         key => true,
141                         tlsaport => [443, 6523],
142                 }
143                 file { '/etc/ssl/debian-local/other-keys/gobby.debian.org.key':
144                         ensure => present,
145                         mode => '0440',
146                         group => 'gobby',
147                         content => inline_template('<%= File.read(scope().call_function("hiera", ["paths.letsencrypt_dir"]) + "/gobby.debian.org.key") %>'),
148                         links => follow,
149                         notify => Exec['reload gobby'],
150                 }
151                 exec { 'reload gobby':
152                         command => 'pkill -u gobby -HUP -x infinoted',
153                         refreshonly => true,
154                 }
155         }
156
157         if has_role('search_backend') {
158                 include roles::search_backend
159         }
160         if has_role('search_frontend') {
161                 include roles::search_frontend
162         }
163
164         if has_role('dgit_browse') {
165                 include roles::dgit_browse
166         }
167         if has_role('dgit_git') {
168                 include roles::dgit_git
169         }
170
171         if $::hostname in [lw01, lw02, lw03, lw04, lw09, lw10] {
172                 include roles::snapshot
173         }
174
175         if has_role('snapshot_web') {
176                 include roles::snapshot_web
177         }
178
179         if has_role('snapshot_shell') {
180                 include roles::snapshot_shell
181         }
182
183         if has_role('planet_master') {
184                 include roles::planet_master
185         }
186         if has_role('planet_search') {
187                 ssl::service { 'planet-search.debian.org': notify  => Exec['service apache2 reload'], key => true, }
188         }
189
190         if has_role('i18n.d.o') {
191                 ssl::service { 'i18n.debian.org': notify  => Exec['service apache2 reload'], key => true, }
192         }
193
194         if has_role('l10n.d.o') {
195                 ssl::service { 'l10n.debian.org': notify  => Exec['service apache2 reload'], key => true, }
196         }
197
198         if has_role('pet.d.n') {
199                 ssl::service { 'pet.debian.net': notify  => Exec['service apache2 reload'], key => true, }
200                 ssl::service { 'pet-devel.debian.net': notify  => Exec['service apache2 reload'], key => true, }
201         }
202
203         if has_role('ports_master') {
204                 include roles::ports_master
205         }
206         if has_role('ports_mirror') {
207                 include roles::ports_mirror
208         }
209
210         if has_role('onionbalance') {
211                 include onion::balance
212         }
213         if has_role('bgp') {
214                 include roles::bgp
215         }
216         if has_role('cdimage-search') {
217                 include roles::cdimage_search
218         }
219
220         if has_role('postgresql_server') {
221                 include postgres::backup_source
222         }
223
224         if has_role('bacula_director') {
225                 include bacula::director
226         } else {
227                 package { 'bacula-console': ensure => purged; }
228                 file { '/etc/bacula/bconsole.conf': ensure => absent; }
229         }
230         if has_role('bacula_storage') {
231                 include bacula::storage
232         }
233
234         if $::keyring_debian_org_mirror {
235                 include roles::keyring_debian_org_mirror
236         }
237
238         if has_role('popcon') {
239                 include roles::popcon
240         }
241
242         if has_role('debsources') {
243                 include roles::debsources
244         }
245 }