From f193c7a7e138b0a25b0b306cde3c54b12858fe58 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Tue, 10 Sep 2019 14:12:49 +0200 Subject: [PATCH] get debian mirror for apt from hiera (not yet doing that for schroot) --- hieradata/common.yaml | 6 ++++++ hieradata/hosters/aql.yaml | 2 ++ hieradata/hosters/arm.yaml | 2 ++ hieradata/hosters/brown.yaml | 2 ++ hieradata/hosters/bytemark.yaml | 2 ++ hieradata/hosters/conova.yaml | 3 +++ hieradata/hosters/csail.yaml | 2 ++ hieradata/hosters/gatech.yaml | 2 ++ hieradata/hosters/man-da.yaml | 2 ++ hieradata/hosters/marist.yaml | 3 +++ hieradata/hosters/osuosl.yaml | 3 +++ hieradata/hosters/sanger.yaml | 2 ++ hieradata/hosters/ubc.yaml | 2 ++ hieradata/hosters/ynic.yaml | 2 ++ hieradata/hosters/zivit.yaml | 2 ++ modules/debian_org/manifests/apt.pp | 8 +------- 16 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 hieradata/hosters/aql.yaml create mode 100644 hieradata/hosters/arm.yaml create mode 100644 hieradata/hosters/brown.yaml create mode 100644 hieradata/hosters/conova.yaml create mode 100644 hieradata/hosters/marist.yaml create mode 100644 hieradata/hosters/osuosl.yaml diff --git a/hieradata/common.yaml b/hieradata/common.yaml index 174a7ddb7..d79bbf8b9 100644 --- a/hieradata/common.yaml +++ b/hieradata/common.yaml @@ -19,6 +19,12 @@ paths: auto_certs_dir: '/srv/puppet.debian.org/ca/RESULT/certs' auto_clientcerts_dir: '/srv/puppet.debian.org/ca/RESULT/clientcerts' +lookup_options: + # entries in other hiera sources add to the array + apt::sources::debian::location: + merge: unique +apt::sources::debian::location: 'http://deb.debian.org/debian/' + # all of these should be retired in favour of including the class role # with the host. weasel, 2019-09 roles: diff --git a/hieradata/hosters/aql.yaml b/hieradata/hosters/aql.yaml new file mode 100644 index 000000000..d5b96e144 --- /dev/null +++ b/hieradata/hosters/aql.yaml @@ -0,0 +1,2 @@ +--- +apt::sources::debian::location: 'https://mirror.bytemark.co.uk/debian/' diff --git a/hieradata/hosters/arm.yaml b/hieradata/hosters/arm.yaml new file mode 100644 index 000000000..d5b96e144 --- /dev/null +++ b/hieradata/hosters/arm.yaml @@ -0,0 +1,2 @@ +--- +apt::sources::debian::location: 'https://mirror.bytemark.co.uk/debian/' diff --git a/hieradata/hosters/brown.yaml b/hieradata/hosters/brown.yaml new file mode 100644 index 000000000..931a59ec5 --- /dev/null +++ b/hieradata/hosters/brown.yaml @@ -0,0 +1,2 @@ +--- +apt::sources::debian::location: 'https://mirrors.wikimedia.org/debian' diff --git a/hieradata/hosters/bytemark.yaml b/hieradata/hosters/bytemark.yaml index 739b2b9df..b56399caf 100644 --- a/hieradata/hosters/bytemark.yaml +++ b/hieradata/hosters/bytemark.yaml @@ -8,3 +8,5 @@ allow_dns_query: local-timeservers: - bm-bl1.debian.org - bm-bl2.debian.org + +apt::sources::debian::location: 'https://mirror.bytemark.co.uk/debian/' diff --git a/hieradata/hosters/conova.yaml b/hieradata/hosters/conova.yaml new file mode 100644 index 000000000..c5c3f44ac --- /dev/null +++ b/hieradata/hosters/conova.yaml @@ -0,0 +1,3 @@ +--- + +apt::sources::debian::location: 'https://mirror.netcologne.de/debian/' diff --git a/hieradata/hosters/csail.yaml b/hieradata/hosters/csail.yaml index e3ff9c7cc..f4b0f36a7 100644 --- a/hieradata/hosters/csail.yaml +++ b/hieradata/hosters/csail.yaml @@ -9,3 +9,5 @@ searchpaths: local-timeservers: - csail-node01.debian.org - csail-node02.debian.org + +apt::sources::debian::location: 'https://mirrors.wikimedia.org/debian' diff --git a/hieradata/hosters/gatech.yaml b/hieradata/hosters/gatech.yaml index 0badec9ac..6f0ae31a6 100644 --- a/hieradata/hosters/gatech.yaml +++ b/hieradata/hosters/gatech.yaml @@ -2,3 +2,5 @@ nameservers: - 143.215.130.231 - 143.215.130.232 + +apt::sources::debian::location: 'https://mirrors.wikimedia.org/debian' diff --git a/hieradata/hosters/man-da.yaml b/hieradata/hosters/man-da.yaml index 8500f91d7..8db6a9e23 100644 --- a/hieradata/hosters/man-da.yaml +++ b/hieradata/hosters/man-da.yaml @@ -12,3 +12,5 @@ searchpaths: local-timeservers: - manda-node03.debian.org - manda-node04.debian.org + +apt::sources::debian::location: 'https://mirror.netcologne.de/debian/' diff --git a/hieradata/hosters/marist.yaml b/hieradata/hosters/marist.yaml new file mode 100644 index 000000000..ca3889d22 --- /dev/null +++ b/hieradata/hosters/marist.yaml @@ -0,0 +1,3 @@ +--- + +apt::sources::debian::location: 'https://mirrors.wikimedia.org/debian' diff --git a/hieradata/hosters/osuosl.yaml b/hieradata/hosters/osuosl.yaml new file mode 100644 index 000000000..ca3889d22 --- /dev/null +++ b/hieradata/hosters/osuosl.yaml @@ -0,0 +1,3 @@ +--- + +apt::sources::debian::location: 'https://mirrors.wikimedia.org/debian' diff --git a/hieradata/hosters/sanger.yaml b/hieradata/hosters/sanger.yaml index 4efe07b07..dc25af7a1 100644 --- a/hieradata/hosters/sanger.yaml +++ b/hieradata/hosters/sanger.yaml @@ -6,3 +6,5 @@ searchpaths: - debprivate-sanger.debian.org allow_dns_query: - 193.62.202.24/29 + +apt::sources::debian::location: 'https://mirror.bytemark.co.uk/debian/' diff --git a/hieradata/hosters/ubc.yaml b/hieradata/hosters/ubc.yaml index ede29bdd7..a146e2441 100644 --- a/hieradata/hosters/ubc.yaml +++ b/hieradata/hosters/ubc.yaml @@ -21,3 +21,5 @@ allow_dns_query: local-timeservers: - ubc-enc2bl01.debian.org - ubc-enc2bl02.debian.org + +apt::sources::debian::location: 'https://mirrors.wikimedia.org/debian' diff --git a/hieradata/hosters/ynic.yaml b/hieradata/hosters/ynic.yaml index 89440d44f..79864bcf8 100644 --- a/hieradata/hosters/ynic.yaml +++ b/hieradata/hosters/ynic.yaml @@ -4,3 +4,5 @@ nameservers: - 144.32.169.75 - 144.32.169.76 firewall_blocks_dns: true + +apt::sources::debian::location: 'https://mirror.bytemark.co.uk/debian/' diff --git a/hieradata/hosters/zivit.yaml b/hieradata/hosters/zivit.yaml index 809a469b4..dbbc60102 100644 --- a/hieradata/hosters/zivit.yaml +++ b/hieradata/hosters/zivit.yaml @@ -3,3 +3,5 @@ nameservers: - 80.245.147.141 - 80.245.147.142 - 80.245.147.143 + +apt::sources::debian::location: 'https://mirror.netcologne.de/debian/' diff --git a/modules/debian_org/manifests/apt.pp b/modules/debian_org/manifests/apt.pp index 5d5b6afa6..eaed3f133 100644 --- a/modules/debian_org/manifests/apt.pp +++ b/modules/debian_org/manifests/apt.pp @@ -3,13 +3,7 @@ # Stuff common to all debian.org servers # class debian_org::apt { - $fallbackmirror = 'http://deb.debian.org/debian/' - - if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') { - $mirror = [ getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), $fallbackmirror ] - } else { - $mirror = [ $fallbackmirror ] - } + $mirror = lookup('apt::sources::debian::location') # jessie if versioncmp($::lsbmajdistrelease, '8') <= 0 { -- 2.20.1