X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fdebian_org%2Fmanifests%2Fapt.pp;h=c46c72f40ca4312bcd673784cbe7db47d71018e2;hb=HEAD;hp=d52005f805aa0bdc416de37b2cb89e784a86f4db;hpb=cead6de02810f62af1f679363843bb3444f11425;p=mirror%2Fdsa-puppet.git diff --git a/modules/debian_org/manifests/apt.pp b/modules/debian_org/manifests/apt.pp index d52005f80..c46c72f40 100644 --- a/modules/debian_org/manifests/apt.pp +++ b/modules/debian_org/manifests/apt.pp @@ -3,46 +3,18 @@ # Stuff common to all debian.org servers # class debian_org::apt { - if versioncmp($::lsbmajdistrelease, '8') <= 0 { - $fallbackmirror = 'http://cdn-fastly.deb.debian.org/debian/' - } else { - $fallbackmirror = 'http://deb.debian.org/debian/' - } + $mirror = lookup('apt::sources::debian::location') - if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') { - $mirror = [ getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), $fallbackmirror ] - } else { - $mirror = [ $fallbackmirror ] + base::aptrepo { 'debian': + url => $mirror, + suite => [ $::lsbdistcodename, "${::lsbdistcodename}-backports", "${::lsbdistcodename}-updates" ], + components => ['main','contrib','non-free'] } - # jessie - if versioncmp($::lsbmajdistrelease, '8') <= 0 { - site::aptrepo { 'debian': - url => $mirror, - suite => [ $::lsbdistcodename ], - components => ['main','contrib','non-free'] - } - # stretch or buster - } else { - site::aptrepo { 'debian': - url => $mirror, - suite => [ $::lsbdistcodename, "${::lsbdistcodename}-backports", "${::lsbdistcodename}-updates" ], - components => ['main','contrib','non-free'] - } - } - - if versioncmp($::lsbmajdistrelease, '8') <= 0 { - site::aptrepo { 'security': - url => [ 'http://security-cdn.debian.org/', 'http://security.debian.org/' ], - suite => "${::lsbdistcodename}/updates", - components => ['main','contrib','non-free'] - } - } else { - site::aptrepo { 'security': - url => [ 'http://security.debian.org/' ], - suite => "${::lsbdistcodename}/updates", - components => ['main','contrib','non-free'] - } + base::aptrepo { 'security': + url => [ 'http://security.debian.org/' ], + suite => "${::lsbdistcodename}/updates", + components => ['main','contrib','non-free'] } # ca-certificates is installed by the ssl module @@ -57,7 +29,7 @@ class debian_org::apt { } } $dbdosuites = [ 'debian-all', $::lsbdistcodename ] - site::aptrepo { 'db.debian.org': + base::aptrepo { 'db.debian.org': url => 'https://db.debian.org/debian-admin', suite => $dbdosuites, components => 'main', @@ -65,39 +37,39 @@ class debian_org::apt { } if ($::hostname in []) { - site::aptrepo { 'proposed-updates': + base::aptrepo { 'proposed-updates': url => $mirror, suite => "${::lsbdistcodename}-proposed-updates", components => ['main','contrib','non-free'] } } else { - site::aptrepo { 'proposed-updates': + base::aptrepo { 'proposed-updates': ensure => absent, } } - site::aptrepo { 'debian-cdn': + base::aptrepo { 'debian-cdn': ensure => absent, } - site::aptrepo { 'debian.org': + base::aptrepo { 'debian.org': ensure => absent, } - site::aptrepo { 'debian2': + base::aptrepo { 'debian2': ensure => absent, } - site::aptrepo { 'backports2.debian.org': + base::aptrepo { 'backports2.debian.org': ensure => absent, } - site::aptrepo { 'backports.debian.org': + base::aptrepo { 'backports.debian.org': ensure => absent, } - site::aptrepo { 'volatile': + base::aptrepo { 'volatile': ensure => absent, } - site::aptrepo { 'db.debian.org-suite': + base::aptrepo { 'db.debian.org-suite': ensure => absent, } - site::aptrepo { 'debian-lts': + base::aptrepo { 'debian-lts': ensure => absent, } @@ -133,12 +105,7 @@ class debian_org::apt { source => 'puppet:///modules/debian_org/apt.conf.d/local-cainfo', } file { '/etc/apt/apt.conf.d/local-pkglist': - source => 'puppet:///modules/debian_org/apt.conf.d/local-pkglist', - } - - exec { 'dpkg list': - command => 'dpkg-query -W -f \'${Package}\n\' > /var/lib/misc/thishost/pkglist', - creates => '/var/lib/misc/thishost/pkglist', + ensure => 'absent', } exec { 'apt-get update':