debian_org::apt: remove jessie support
[mirror/dsa-puppet.git] / modules / debian_org / manifests / apt.pp
1 # == Class: debian_org
2 #
3 # Stuff common to all debian.org servers
4 #
5 class debian_org::apt {
6         $mirror = lookup('apt::sources::debian::location')
7
8         base::aptrepo { 'debian':
9                 url        => $mirror,
10                 suite      => [ $::lsbdistcodename, "${::lsbdistcodename}-backports", "${::lsbdistcodename}-updates" ],
11                 components => ['main','contrib','non-free']
12         }
13
14         base::aptrepo { 'security':
15                 url        => [ 'http://security.debian.org/' ],
16                 suite      => "${::lsbdistcodename}/updates",
17                 components => ['main','contrib','non-free']
18         }
19
20         # ca-certificates is installed by the ssl module
21         if versioncmp($::lsbmajdistrelease, '9') <= 0 {
22                 package { 'apt-transport-https':
23                         ensure => installed,
24                 }
25         } else {
26                 # transitional package in buster
27                 package { 'apt-transport-https':
28                         ensure => purged,
29                 }
30         }
31         $dbdosuites = [ 'debian-all', $::lsbdistcodename ]
32         base::aptrepo { 'db.debian.org':
33                 url        => 'https://db.debian.org/debian-admin',
34                 suite      => $dbdosuites,
35                 components => 'main',
36                 key        => 'puppet:///modules/debian_org/db.debian.org.gpg',
37         }
38
39         if ($::hostname in []) {
40                 base::aptrepo { 'proposed-updates':
41                         url        => $mirror,
42                         suite      => "${::lsbdistcodename}-proposed-updates",
43                         components => ['main','contrib','non-free']
44                 }
45         } else {
46                 base::aptrepo { 'proposed-updates':
47                         ensure => absent,
48                 }
49         }
50
51         base::aptrepo { 'debian-cdn':
52                 ensure => absent,
53         }
54         base::aptrepo { 'debian.org':
55                 ensure => absent,
56         }
57         base::aptrepo { 'debian2':
58                 ensure => absent,
59         }
60         base::aptrepo { 'backports2.debian.org':
61                 ensure => absent,
62         }
63         base::aptrepo { 'backports.debian.org':
64                 ensure => absent,
65         }
66         base::aptrepo { 'volatile':
67                 ensure => absent,
68         }
69         base::aptrepo { 'db.debian.org-suite':
70                 ensure => absent,
71         }
72         base::aptrepo { 'debian-lts':
73                 ensure => absent,
74         }
75
76
77
78
79         file { '/etc/apt/trusted-keys.d':
80                 ensure => absent,
81                 force  => true,
82         }
83
84         file { '/etc/apt/trusted.gpg':
85                 mode    => '0600',
86                 content => "",
87         }
88
89         file { '/etc/apt/preferences':
90                 source => 'puppet:///modules/debian_org/apt.preferences',
91         }
92         file { '/etc/apt/apt.conf.d/local-compression':
93                 source => 'puppet:///modules/debian_org/apt.conf.d/local-compression',
94         }
95         file { '/etc/apt/apt.conf.d/local-recommends':
96                 source => 'puppet:///modules/debian_org/apt.conf.d/local-recommends',
97         }
98         file { '/etc/apt/apt.conf.d/local-pdiffs':
99                 source => 'puppet:///modules/debian_org/apt.conf.d/local-pdiffs',
100         }
101         file { '/etc/apt/apt.conf.d/local-langs':
102                 source => 'puppet:///modules/debian_org/apt.conf.d/local-langs',
103         }
104         file { '/etc/apt/apt.conf.d/local-cainfo':
105                 source => 'puppet:///modules/debian_org/apt.conf.d/local-cainfo',
106         }
107         file { '/etc/apt/apt.conf.d/local-pkglist':
108                 source => 'puppet:///modules/debian_org/apt.conf.d/local-pkglist',
109         }
110
111         exec { 'dpkg list':
112                 command => 'dpkg-query -W -f \'${Package}\n\' > /var/lib/misc/thishost/pkglist',
113                 creates => '/var/lib/misc/thishost/pkglist',
114         }
115
116         exec { 'apt-get update':
117                 path    => '/usr/bin:/usr/sbin:/bin:/sbin',
118                 onlyif  => '/usr/local/bin/check_for_updates',
119                 require => File['/usr/local/bin/check_for_updates']
120         }
121         Exec['apt-get update']->Package<| tag == extra_repo |>
122 }