schroot: use hiera debian mirror
authorPeter Palfrader <peter@palfrader.org>
Tue, 10 Sep 2019 14:25:33 +0000 (16:25 +0200)
committerPeter Palfrader <peter@palfrader.org>
Tue, 10 Sep 2019 14:25:33 +0000 (16:25 +0200)
modules/schroot/manifests/init.pp
modules/schroot/templates/default-mirror.erb [deleted file]

index 7c5e008..4bd8964 100644 (file)
@@ -1,4 +1,6 @@
 class schroot {
+       $mirror = lookup('apt::sources::debian::location', {'strategy' => 'first'})
+
        package { 'schroot':
                ensure => installed,
                tag    => extra_repo,
@@ -53,7 +55,9 @@ class schroot {
                require => Package['schroot'],
        }
        file { '/etc/schroot/dsa/default-mirror':
-               content => template('schroot/default-mirror.erb'),
+               content => @("EOT"),
+                       $mirror
+                       | EOT
        }
        file { '/etc/schroot/dsa/config':
                source  => 'puppet:///modules/schroot/schroot-dsa/config',
diff --git a/modules/schroot/templates/default-mirror.erb b/modules/schroot/templates/default-mirror.erb
deleted file mode 100644 (file)
index ab8772f..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<%=
-ninfo = scope.lookupvar('site::nodeinfo')
-if ninfo['hoster'].has_key?('mirror-debian') then
-    ninfo['hoster']['mirror-debian']
-else
-    'https://deb.debian.org/debian'
-end
-%>