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