Remove /srv/ftp.root from security mirrors
[mirror/dsa-puppet.git] / modules / roles / manifests / security_mirror.pp
1 class roles::security_mirror {
2         include roles::archvsync_base
3
4         $binds = $::hostname ? {
5                 mirror-anu      => [ '150.203.164.61', '[2001:388:1034:2900::3d]' ],
6                 mirror-bytemark => [ '5.153.231.46', '[2001:41c8:1000:21::21:46]' ],
7                 mirror-conova   => [ '217.196.149.233', '[2a02:16a8:dc41:100::233]' ],
8                 mirror-isc      => [ '149.20.4.14', '[2001:4f8:1:c::14]' ],
9                 mirror-umn      => [ '128.101.240.215', '[2607:ea00:101:3c0b::1deb:215]' ],
10                 default         => [ '[::]' ],
11         }
12
13         include apache2::expires
14         include apache2::rewrite
15
16         apache2::site { '010-security.debian.org':
17                 site   => 'security.debian.org',
18                 content => template('roles/security_mirror/security.debian.org.erb')
19         }
20
21         $mirrors = hiera('roles.security_mirror', {})
22         $fastly_mirrors = $mirrors.filter |$h| { $h[1]['fastly-backend'] }
23         $hosts_to_check = $fastly_mirrors.map |$h| { $h[1]['service-hostname'] }
24
25         roles::mirror_health { 'security':
26                 check_hosts   => $hosts_to_check,
27                 check_service => 'security',
28                 url           => 'http://security.backend.mirrors.debian.org/debian/dists/sid/Release',
29                 health_url    => 'http://security.backend.mirrors.debian.org/_health',
30         }
31
32         rsync::site { 'security':
33                 source      => 'puppet:///modules/roles/security_mirror/rsyncd.conf',
34                 max_clients => 100,
35                 binds       => $binds,
36         }
37
38         $onion_v4_addr = hiera("roles.security_mirror", {})
39                 .dig($::fqdn, 'onion_v4_address')
40         if $onion_v4_addr {
41                 onion::service { 'security.debian.org':
42                         port => 80,
43                         target_port => 80,
44                         target_address => $onion_v4_addr,
45                 }
46         }
47 }