Move debian_mirror over to being a hash
[mirror/dsa-puppet.git] / modules / roles / manifests / debian_mirror.pp
index 302c5d8..4fa22b8 100644 (file)
@@ -39,11 +39,8 @@ class roles::debian_mirror {
                }
        }
 
-       # roles is a list of hashes, which needs to be unpacked into a regular hash
-       $mirrors = hiera('roles.debian_mirror', [])
-       # unpack $mirrors and construct a hash
-       $m2 = Hash($mirrors.map |$h| { $h.map |$k, $v| { [$k, $v] }[0]})
-       $fastly_mirrors = $m2.filter |$h| { $h[1]['fastly-backend'] }
+       $mirrors = hiera('roles.debian_mirror', {})
+       $fastly_mirrors = $mirrors.filter |$h| { $h[1]['fastly-backend'] }
        $hosts_to_check = $fastly_mirrors.map |$h| { $h[1]['service-hostname'] }
 
        roles::mirror_health { 'ftp':