Add mipsel-osuosl-02.debian.org
[mirror/dsa-puppet.git] / modules / debian_org / manifests / apt.pp
index 32a1fa8..d52005f 100644 (file)
@@ -15,10 +15,20 @@ class debian_org::apt {
                $mirror = [ $fallbackmirror ]
        }
 
-       site::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 {
@@ -35,9 +45,20 @@ class debian_org::apt {
                }
        }
 
+       # ca-certificates is installed by the ssl module
+       if versioncmp($::lsbmajdistrelease, '9') <= 0 {
+               package { 'apt-transport-https':
+                       ensure => installed,
+               }
+       } else {
+               # transitional package in buster
+               package { 'apt-transport-https':
+                       ensure => purged,
+               }
+       }
        $dbdosuites = [ 'debian-all', $::lsbdistcodename ]
        site::aptrepo { 'db.debian.org':
-               url        => 'http://db.debian.org/debian-admin',
+               url        => 'https://db.debian.org/debian-admin',
                suite      => $dbdosuites,
                components => 'main',
                key        => 'puppet:///modules/debian_org/db.debian.org.gpg',
@@ -108,6 +129,17 @@ class debian_org::apt {
        file { '/etc/apt/apt.conf.d/local-langs':
                source => 'puppet:///modules/debian_org/apt.conf.d/local-langs',
        }
+       file { '/etc/apt/apt.conf.d/local-cainfo':
+               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',
+       }
 
        exec { 'apt-get update':
                path    => '/usr/bin:/usr/sbin:/bin:/sbin',