X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fdebian_org%2Fmanifests%2Fapt.pp;h=d52005f805aa0bdc416de37b2cb89e784a86f4db;hb=9a1fd5f05a8593ae282383bbace383992cb720ff;hp=9fc02a0b2a22b7a3ae637b00eae84ae131a852f5;hpb=249b713a08d35bffb1cd52739be6f5808baa5a5f;p=mirror%2Fdsa-puppet.git diff --git a/modules/debian_org/manifests/apt.pp b/modules/debian_org/manifests/apt.pp index 9fc02a0b2..d52005f80 100644 --- a/modules/debian_org/manifests/apt.pp +++ b/modules/debian_org/manifests/apt.pp @@ -3,53 +3,71 @@ # Stuff common to all debian.org servers # class debian_org::apt { - if $::lsbmajdistrelease <= '7' { - $mungedcodename = $::lsbdistcodename - } elsif ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) { - $mungedcodename = "${::lsbdistcodename}-kfreebsd" - } else { - $mungedcodename = $::lsbdistcodename - } - - if $::lsbmajdistrelease <= '8' { + if versioncmp($::lsbmajdistrelease, '8') <= 0 { $fallbackmirror = 'http://cdn-fastly.deb.debian.org/debian/' } else { $fallbackmirror = 'http://deb.debian.org/debian/' } if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') { - $mirror = [ getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), $fallbackmirror, 'http://debian.anycast-test.mirrors.debian.org/debian/' ] + $mirror = [ getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), $fallbackmirror ] } else { - $mirror = [ $fallbackmirror, 'http://debian.anycast-test.mirrors.debian.org/debian/' ] + $mirror = [ $fallbackmirror ] } - site::aptrepo { 'debian': - url => $mirror, - suite => [ $mungedcodename, "${::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'] + } } - site::aptrepo { 'security': - url => [ 'http://security-cdn.debian.org/', 'http://security.anycast-test.mirrors.debian.org/debian-security/', 'http://security.debian.org/' ], - suite => "${mungedcodename}/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'] + } } - if has_role('experimental_apache') { - $dbdosuites = [ 'debian-all', $::lsbdistcodename, 'jessie-apache2' ] + # ca-certificates is installed by the ssl module + if versioncmp($::lsbmajdistrelease, '9') <= 0 { + package { 'apt-transport-https': + ensure => installed, + } } else { - $dbdosuites = [ 'debian-all', $::lsbdistcodename ] + # 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', } - if ($::hostname in [] or $::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) { + if ($::hostname in []) { site::aptrepo { 'proposed-updates': url => $mirror, - suite => "${mungedcodename}-proposed-updates", + suite => "${::lsbdistcodename}-proposed-updates", components => ['main','contrib','non-free'] } } else { @@ -111,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',