1 # a mirror for debug.debian.org
3 # @param listen_addr IP addresses to have apache listen on
4 # @param onion_service provide the onion service from this host
5 # @param healthcheck_name name to access this node in the health checker
6 class roles::debug_mirror(
7 Array[Stdlib::IP::Address] $listen_addr = [],
8 Boolean $onion_service = false,
9 Optional[String] $healthcheck_name = undef,
11 include roles::archvsync_base
14 $_enclosed_addresses = empty($listen_addr) ? {
16 default => enclose_ipv6($listen_addr),
18 $vhost_listen = $_enclosed_addresses.map |$a| { "${a}:80" } .join(' ')
20 $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix')
21 $archive_root = "${mirror_basedir_prefix}debian-debug"
23 apache2::site { '010-debug.mirrors.debian.org':
24 site => 'debug.mirrors.debian.org',
25 content => template('roles/apache-debug.mirrors.debian.org.erb'),
29 $onion_addr = empty($listen_addr) ? {
30 true => $base::public_address,
31 default => filter_ipv4($listen_addr)[0]
34 fail("Do not have a useable address for the onionservice on ${::hostname}. Is \$listen_addr empty or does it not have an IPv4 address?.")
37 onion::service { 'debug.mirrors.debian.org':
40 target_address => $onion_addr,
44 Ferm::Rule::Simple <<| tag == 'ssh::server::from::ftp_master' |>>
46 $healthcheck_ensure = $healthcheck_name == undef ? {
50 mirror_health::service { 'debug':
51 ensure => $healthcheck_ensure,
52 this_host_service_name => $healthcheck_name,
53 url => 'http://debug.backend.mirrors.debian.org/debian-debug/dists/sid-debug/Release',
54 health_url => 'http://debug.backend.mirrors.debian.org/_health',