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