reload apache instead of restarting it
[mirror/dsa-puppet.git] / modules / roles / manifests / security_mirror.pp
1 class roles::security_mirror {
2         $rsync_bind = $::hostname ? {
3                 mirror-anu => '150.203.164.61',
4                 mirror-isc => '149.20.20.19',
5                 mirror-umn => '128.101.240.215',
6                 default    => '',
7         }
8         $rsync_bind6 = $::hostname ? {
9                 mirror-anu => '2001:388:1034:2900::3d',
10                 mirror-isc => '2001:4f8:8:36::1deb:19',
11                 mirror-umn => '2607:ea00:101:3c0b::1deb:215',
12                 default    => '',
13         }
14
15         include apache2::cache
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         include ferm::ftp_conntrack
22         vsftpd::site { 'security':
23                 banner       => 'security.debian.org FTP server (vsftpd)',
24                 logfile      => '/var/log/ftp/vsftpd-security.debian.org.log',
25                 max_clients  => 200,
26                 root         => '/srv/ftp.root/',
27         }
28
29         rsync::site { 'security':
30                 source      => 'puppet:///modules/roles/security_mirror/rsyncd.conf',
31                 max_clients => 100,
32                 bind        => $rsync_bind,
33                 bind6       => $rsync_bind6,
34         }
35
36
37         $onion_v4_addr = $::hostname ? {
38                 mirror-anu => '150.203.164.61',
39                 mirror-isc => '149.20.20.19',
40                 mirror-umn => '128.101.240.215',
41                 villa      => '212.211.132.32',
42                 lobos      => '212.211.132.250',
43                 default   => undef,
44         }
45         if has_role('security_mirror_onion') {
46                 if ! $onion_v4_addr {
47                         fail("Do not have an onion_v4_addr set for $::hostname.")
48                 }
49
50                 onion::service { 'security.debian.org':
51                         port => 80,
52                         target_port => 80,
53                         target_address => $onion_v4_addr,
54                 }
55         }
56 }