3 # Stuff common to all debian.org servers
5 class debian_org::apt {
6 if $::lsbmajdistrelease <= '7' {
7 $mungedcodename = $::lsbdistcodename
8 } elsif ($::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
9 $mungedcodename = "${::lsbdistcodename}-kfreebsd"
11 $mungedcodename = $::lsbdistcodename
14 if $::lsbmajdistrelease <= '8' {
15 $fallbackmirror = 'http://cdn-fastly.deb.debian.org/debian/'
17 $fallbackmirror = 'http://deb.debian.org/debian/'
20 if getfromhash($site::nodeinfo, 'hoster', 'mirror-debian') {
21 $mirror = [ getfromhash($site::nodeinfo, 'hoster', 'mirror-debian'), $fallbackmirror, 'http://debian.anycast-test.mirrors.debian.org/debian/' ]
23 $mirror = [ $fallbackmirror, 'http://debian.anycast-test.mirrors.debian.org/debian/' ]
26 site::aptrepo { 'debian':
28 suite => [ $mungedcodename, "${::lsbdistcodename}-backports", "${::lsbdistcodename}-updates" ],
29 components => ['main','contrib','non-free']
31 site::aptrepo { 'security':
32 url => [ 'http://security-cdn.debian.org/', 'http://security.anycast-test.mirrors.debian.org/debian-security/', 'http://security.debian.org/' ],
33 suite => "${mungedcodename}/updates",
34 components => ['main','contrib','non-free']
37 if has_role('experimental_apache') {
38 $dbdosuites = [ 'debian-all', $::lsbdistcodename, 'jessie-apache2' ]
40 $dbdosuites = [ 'debian-all', $::lsbdistcodename ]
42 site::aptrepo { 'db.debian.org':
43 url => 'http://db.debian.org/debian-admin',
46 key => 'puppet:///modules/debian_org/db.debian.org.gpg',
49 if ($::hostname in [] or $::debarchitecture in ['kfreebsd-amd64', 'kfreebsd-i386']) {
50 site::aptrepo { 'proposed-updates':
52 suite => "${mungedcodename}-proposed-updates",
53 components => ['main','contrib','non-free']
56 site::aptrepo { 'proposed-updates':
61 site::aptrepo { 'debian-cdn':
64 site::aptrepo { 'debian.org':
67 site::aptrepo { 'debian2':
70 site::aptrepo { 'backports2.debian.org':
73 site::aptrepo { 'backports.debian.org':
76 site::aptrepo { 'volatile':
79 site::aptrepo { 'db.debian.org-suite':
82 site::aptrepo { 'debian-lts':
89 file { '/etc/apt/trusted-keys.d':
94 file { '/etc/apt/trusted.gpg':
99 file { '/etc/apt/preferences':
100 source => 'puppet:///modules/debian_org/apt.preferences',
102 file { '/etc/apt/apt.conf.d/local-compression':
103 source => 'puppet:///modules/debian_org/apt.conf.d/local-compression',
105 file { '/etc/apt/apt.conf.d/local-recommends':
106 source => 'puppet:///modules/debian_org/apt.conf.d/local-recommends',
108 file { '/etc/apt/apt.conf.d/local-pdiffs':
109 source => 'puppet:///modules/debian_org/apt.conf.d/local-pdiffs',
111 file { '/etc/apt/apt.conf.d/local-langs':
112 source => 'puppet:///modules/debian_org/apt.conf.d/local-langs',
115 exec { 'apt-get update':
116 path => '/usr/bin:/usr/sbin:/bin:/sbin',
117 onlyif => '/usr/local/bin/check_for_updates',
118 require => File['/usr/local/bin/check_for_updates']
120 Exec['apt-get update']->Package<| tag == extra_repo |>