bind address for security, debug and debian mirror on conova
[mirror/dsa-puppet.git] / modules / roles / manifests / security_mirror.pp
1 class roles::security_mirror {
2         include roles::archvsync_base
3
4         $rsync_bind = $::hostname ? {
5                 mirror-anu => '150.203.164.61',
6                 mirror-conova => '217.196.149.233',
7                 mirror-isc => '149.20.4.14',
8                 mirror-umn => '128.101.240.215',
9                 default    => '',
10         }
11         $rsync_bind6 = $::hostname ? {
12                 mirror-anu => '2001:388:1034:2900::3d',
13                 mirror-conova => '2a02:16a8:dc41:100::233'
14                 mirror-isc => '2001:4f8:1:c::14',
15                 mirror-umn => '2607:ea00:101:3c0b::1deb:215',
16                 default    => '',
17         }
18         $ftp_bind = $::hostname ? {
19                 mirror-anu => '150.203.164.61',
20                 default => '',
21         }
22         $ftp_bind6 = $::hostname ? {
23                 mirror-anu => '2001:388:1034:2900::3d',
24                 default => undef,
25         }
26
27         file { '/srv/mirrors/debian-security':
28                 ensure => link,
29                 target => '../ftp.root/debian-security',
30         }
31
32         include apache2::expires
33         include apache2::rewrite
34
35         apache2::site { '010-security.debian.org':
36                 site   => 'security.debian.org',
37                 content => template('roles/security_mirror/security.debian.org.erb')
38         }
39
40         include ferm::ftp_conntrack
41         vsftpd::site { 'security':
42                 banner       => 'security.debian.org FTP server (vsftpd)',
43                 logfile      => '/var/log/ftp/vsftpd-security.debian.org.log',
44                 max_clients  => 200,
45                 root         => '/srv/ftp.root/',
46                 bind         => $ftp_bind,
47         }
48         if ($ftp_bind6) {
49                 vsftpd::site { 'security6':
50                         banner       => 'security.debian.org FTP server (vsftpd)',
51                         logfile      => '/var/log/ftp/vsftpd-security6.debian.org.log',
52                         max_clients  => 200,
53                         root         => '/srv/ftp.root/',
54                         bind         => $ftp_bind6,
55                 }
56         }
57
58         rsync::site { 'security':
59                 source      => 'puppet:///modules/roles/security_mirror/rsyncd.conf',
60                 max_clients => 100,
61                 bind        => $rsync_bind,
62                 bind6       => $rsync_bind6,
63         }
64
65         $onion_v4_addr = $::hostname ? {
66                 mirror-anu => '150.203.164.61',
67                 mirror-isc => '149.20.4.14',
68                 mirror-umn => '128.101.240.215',
69                 villa      => '212.211.132.32',
70                 lobos      => '212.211.132.250',
71                 default   => undef,
72         }
73         if has_role('security_mirror_onion') {
74                 if ! $onion_v4_addr {
75                         fail("Do not have an onion_v4_addr set for $::hostname.")
76                 }
77
78                 onion::service { 'security.debian.org':
79                         port => 80,
80                         target_port => 80,
81                         target_address => $onion_v4_addr,
82                 }
83         }
84 }