X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fdebian_org%2Fmanifests%2Fapt.pp;h=8ff0877463024caa2b09aa71dfc27d97b3cc1a22;hb=9c6e5abb124b6664dea47f2637e431286433b677;hp=48b617e6e059bd5a5b8d22eeef09dbf439e713c5;hpb=fc98f0be58f40cfae2d854bc7a2b4eeefc1c4146;p=mirror%2Fdsa-puppet.git diff --git a/modules/debian_org/manifests/apt.pp b/modules/debian_org/manifests/apt.pp index 48b617e6e..8ff087746 100644 --- a/modules/debian_org/manifests/apt.pp +++ b/modules/debian_org/manifests/apt.pp @@ -3,14 +3,6 @@ # Stuff common to all debian.org servers # class debian_org::apt { - if versioncmp($::lsbmajdistrelease, '7') <= 0 { - $mungedcodename = $::lsbdistcodename - } elsif ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) { - $mungedcodename = "${::lsbdistcodename}-kfreebsd" - } else { - $mungedcodename = $::lsbdistcodename - } - if versioncmp($::lsbmajdistrelease, '8') <= 0 { $fallbackmirror = 'http://cdn-fastly.deb.debian.org/debian/' } else { @@ -18,75 +10,94 @@ class debian_org::apt { } 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 { + base::aptrepo { 'debian': + url => $mirror, + suite => [ $::lsbdistcodename ], + components => ['main','contrib','non-free'] + } + # stretch or buster + } else { + base::aptrepo { 'debian': + url => $mirror, + suite => [ $::lsbdistcodename, "${::lsbdistcodename}-backports", "${::lsbdistcodename}-updates" ], + components => ['main','contrib','non-free'] + } } - if ($::hostname in [smetana]) { - site::aptrepo { 'security': - ensure => absent, + if versioncmp($::lsbmajdistrelease, '8') <= 0 { + base::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-cdn.debian.org/', 'http://security.anycast-test.mirrors.debian.org/debian-security/', 'http://security.debian.org/' ], - suite => "${mungedcodename}/updates", + base::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, + } } - site::aptrepo { 'db.debian.org': - url => 'http://db.debian.org/debian-admin', + $dbdosuites = [ 'debian-all', $::lsbdistcodename ] + base::aptrepo { 'db.debian.org': + 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']) { - site::aptrepo { 'proposed-updates': + if ($::hostname in []) { + base::aptrepo { 'proposed-updates': url => $mirror, - suite => "${mungedcodename}-proposed-updates", + 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, } @@ -118,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',