apt: Always enable backports repo with lower priority
See https://help.ubuntu.com/community/UbuntuBackports#Configuring_Backports_for_Manual_Install
This commit is contained in:
parent
158a20a642
commit
f8f5b373dc
2 changed files with 11 additions and 8 deletions
|
@ -85,14 +85,9 @@ define apt::ppa($ensure = "present") {
|
||||||
# Base URL of security repository.
|
# Base URL of security repository.
|
||||||
# Defaults to "mirror://mirrors.ubuntu.com/mirrors.txt".
|
# Defaults to "mirror://mirrors.ubuntu.com/mirrors.txt".
|
||||||
#
|
#
|
||||||
# $backports:
|
|
||||||
# Boolean for enabling the backports repositories.
|
|
||||||
# Defaults to true.
|
|
||||||
#
|
|
||||||
class apt::sources(
|
class apt::sources(
|
||||||
$archive_url="mirror://mirrors.ubuntu.com/mirrors.txt",
|
$archive_url="mirror://mirrors.ubuntu.com/mirrors.txt",
|
||||||
$security_url="mirror://mirrors.ubuntu.com/mirrors.txt",
|
$security_url="mirror://mirrors.ubuntu.com/mirrors.txt"
|
||||||
$backports=true
|
|
||||||
) {
|
) {
|
||||||
|
|
||||||
tag("bootstrap")
|
tag("bootstrap")
|
||||||
|
@ -108,6 +103,16 @@ class apt::sources(
|
||||||
notify => Exec["apt-get-update"],
|
notify => Exec["apt-get-update"],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if $::operatingsystem == "Ubuntu" and versioncmp($::operatingsystemrelease, "11.04") < 0 {
|
||||||
|
file { "/etc/apt/preferences.d/backports.pref":
|
||||||
|
ensure => present,
|
||||||
|
mode => "0644",
|
||||||
|
owner => "root",
|
||||||
|
group => "root",
|
||||||
|
content => "Package: *\nPin: release a=${::lsbdistcodename}-backports\nPin-Priority: 100\n",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,6 @@ deb-src <%= @archive_url %> <%= @lsbdistcodename %>-updates main restricted univ
|
||||||
|
|
||||||
deb <%= @security_url %> <%= @lsbdistcodename %>-security main restricted universe multiverse
|
deb <%= @security_url %> <%= @lsbdistcodename %>-security main restricted universe multiverse
|
||||||
deb-src <%= @security_url %> <%= @lsbdistcodename %>-security main restricted universe multiverse
|
deb-src <%= @security_url %> <%= @lsbdistcodename %>-security main restricted universe multiverse
|
||||||
<% if @backports == true -%>
|
|
||||||
|
|
||||||
deb <%= @archive_url %> <%= @lsbdistcodename %>-backports main restricted universe multiverse
|
deb <%= @archive_url %> <%= @lsbdistcodename %>-backports main restricted universe multiverse
|
||||||
deb-src <%= @archive_url %> <%= @lsbdistcodename %>-backports main restricted universe multiverse
|
deb-src <%= @archive_url %> <%= @lsbdistcodename %>-backports main restricted universe multiverse
|
||||||
<% end -%>
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue