Pull list of hosts to health check from hiera
[mirror/dsa-puppet.git] / modules / roles / manifests / debian_mirror.pp
index c3e2ab1..6e563aa 100644 (file)
@@ -37,8 +37,12 @@ class roles::debian_mirror {
                }
        }
 
+       $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'] }
+
         roles::mirror_health { 'ftp':
-               check_hosts   => ['accumu.debian.backend.mirrors.debian.org', 'bytemark.debian.backend.mirrors.debian.org', 'conova.debian.backend.mirrors.debian.org', 'skroutz.debian.backend.mirrors.debian.org'],
+               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',