3 # Stuff common to all debian.org servers
5 class debian_org::apt {
6 if versioncmp($::lsbmajdistrelease, '8') <= 0 {
7 $fallbackmirror = 'http://cdn-fastly.deb.debian.org/debian/'
9 $fallbackmirror = 'http://deb.debian.org/debian/'
12 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
13 $mirror = [ getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), $fallbackmirror ]
15 $mirror = [ $fallbackmirror ]
18 site::aptrepo { 'debian':
20 suite => [ $::lsbdistcodename, "${::lsbdistcodename}-backports", "${::lsbdistcodename}-updates" ],
21 components => ['main','contrib','non-free']
24 if versioncmp($::lsbmajdistrelease, '8') <= 0 {
25 site::aptrepo { 'security':
26 url => [ 'http://security-cdn.debian.org/', 'http://security.debian.org/' ],
27 suite => "${::lsbdistcodename}/updates",
28 components => ['main','contrib','non-free']
31 site::aptrepo { 'security':
32 url => [ 'http://security.debian.org/' ],
33 suite => "${::lsbdistcodename}/updates",
34 components => ['main','contrib','non-free']
38 # ca-certificates is installed by the ssl module
39 if versioncmp($::lsbmajdistrelease, '9') <= 0 {
40 package { 'apt-transport-https':
44 # transitional package in buster
45 package { 'apt-transport-https':
49 $dbdosuites = [ 'debian-all', $::lsbdistcodename ]
50 site::aptrepo { 'db.debian.org':
51 url => 'https://db.debian.org/debian-admin',
54 key => 'puppet:///modules/debian_org/db.debian.org.gpg',
57 if ($::hostname in []) {
58 site::aptrepo { 'proposed-updates':
60 suite => "${::lsbdistcodename}-proposed-updates",
61 components => ['main','contrib','non-free']
64 site::aptrepo { 'proposed-updates':
69 site::aptrepo { 'debian-cdn':
72 site::aptrepo { 'debian.org':
75 site::aptrepo { 'debian2':
78 site::aptrepo { 'backports2.debian.org':
81 site::aptrepo { 'backports.debian.org':
84 site::aptrepo { 'volatile':
87 site::aptrepo { 'db.debian.org-suite':
90 site::aptrepo { 'debian-lts':
97 file { '/etc/apt/trusted-keys.d':
102 file { '/etc/apt/trusted.gpg':
107 file { '/etc/apt/preferences':
108 source => 'puppet:///modules/debian_org/apt.preferences',
110 file { '/etc/apt/apt.conf.d/local-compression':
111 source => 'puppet:///modules/debian_org/apt.conf.d/local-compression',
113 file { '/etc/apt/apt.conf.d/local-recommends':
114 source => 'puppet:///modules/debian_org/apt.conf.d/local-recommends',
116 file { '/etc/apt/apt.conf.d/local-pdiffs':
117 source => 'puppet:///modules/debian_org/apt.conf.d/local-pdiffs',
119 file { '/etc/apt/apt.conf.d/local-langs':
120 source => 'puppet:///modules/debian_org/apt.conf.d/local-langs',
123 exec { 'apt-get update':
124 path => '/usr/bin:/usr/sbin:/bin:/sbin',
125 onlyif => '/usr/local/bin/check_for_updates',
126 require => File['/usr/local/bin/check_for_updates']
128 Exec['apt-get update']->Package<| tag == extra_repo |>