use expires on archive
[mirror/dsa-puppet.git] / modules / roles / manifests / historical_mirror.pp
1 class roles::historical_mirror {
2         include apache2::expires
3
4         $vhost_listen = $::hostname ? {
5                 default => '*:80',
6         }
7         $onion_v4_addr = $::hostname ? {
8                 default    => undef,
9         }
10         $archive_root = $::hostname ? {
11                 default    => '/srv/mirrors/debian-archive',
12         }
13
14         apache2::site { '010-archive.debian.org':
15                 site   => 'archive.debian.org',
16                 content => template('roles/apache-archive.debian.org.erb'),
17         }
18
19         if has_role('historical_mirror_onion') {
20                 if ! $onion_v4_addr {
21                         fail("Do not have an onion_v4_addr set for $::hostname.")
22                 }
23
24                 onion::service { 'archive.debian.org':
25                         port => 80,
26                         target_port => 80,
27                         target_address => $onion_v4_addr,
28                 }
29         }
30 }