class roles::debian_mirror { include roles::archvsync_base $mirror_basedir_prefix = hiera('role_config__mirrors.mirror_basedir_prefix') $archive_root = "${mirror_basedir_prefix}debian" $vhost_listen = join([ hiera("roles.debian_mirror.${::hostname}.listen-addresses", 'missing') ? { 'missing' => '*:80', default => join([hiera("roles.debian_mirror.${::hostname}.listen-addresses"), '127.0.0.1:80', '[::1]:80']) }, has_role('bgp') ? { true => '193.31.7.2:80 [2a02:158:ffff:deb::2]:80', default => '', }], ' ') $onion_v4_addr = $::hostname ? { mirror-bytemark => '5.153.231.45', klecker => '130.89.148.12', mirror-isc => '149.20.4.15', default => undef, } apache2::site { '010-ftp.debian.org': site => 'ftp.debian.org', content => template('roles/apache-ftp.debian.org.erb'), } if has_role('debian_mirror_onion') { if ! $onion_v4_addr { fail("Do not have an onion_v4_addr set for $::hostname.") } onion::service { 'ftp.debian.org': port => 80, target_port => 80, target_address => $onion_v4_addr, } } # $mirrors = hiera_hash('roles::debian_mirror',[]) # $fastly_mirrors = $mirrors.filter |$h| { $h[1]['fastly-backend'] } # $hosts_to_check = $fastly_mirrors.map | $h| { $h1['service-hostname'] } $hosts_to_check = ['accumu.debian.backend.mirrors.debian.org', 'bytemark.debian.backend.mirrors.debian.org', 'conova.debian.backend.mirrors.debian.org', 'skroutz.debian.backend.mirrors.debian.org'] roles::mirror_health { 'ftp': check_hosts => $hosts_to_check, check_service => 'ftp', url => 'http://debian.backend.mirrors.debian.org/debian/dists/sid/Release', health_url => 'http://debian.backend.mirrors.debian.org/_health', } }