1 # a mirror of ports.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 class roles::ports_mirror(
6 Array[Stdlib::IP::Address] $listen_addr = [],
7 Boolean $onion_service = false,
9 include roles::archvsync_base
13 $_enclosed_addresses = empty($listen_addr) ? {
15 default => enclose_ipv6($listen_addr),
17 $_addr_port_elements = $_enclosed_addresses.map |$a| { "${a}:80" }
18 $vhost_listen = join($_addr_port_elements, ' ')
20 $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix')
21 $archive_root = "${mirror_basedir_prefix}debian-ports"
23 apache2::site { '010-ftp.ports.debian.org':
24 site => 'ftp.ports.debian.org',
25 content => template('roles/apache-ftp.ports.debian.org.erb'),
29 $onion_addr = filter_ipv4($listen_addr)[0]
31 fail("Do not have a useable address for the onionservice on ${::hostname}. Is \$listen_addr empty or does it not have an IPv4 address?.")
34 onion::service { 'ftp.ports.debian.org':
37 target_address => $onion_addr,