Merge branch 'volatile-backports' into 'master'

allow disabling backports (and volatile in ubuntu)

as the module stands now, there's no way to disable backports.

there are a few reasons why we want to allow this:

* "tools, not policy" - if Debian doesn't ship with backports enabled by default, why should we change that policy?
* too many sources.list entries can cause problems on `apt-get update`, which can run out of memory and require special config
* if the pinning fails, some packages may be updated by mistake
* even if pinning works, some may *want* to keep admins from installing anything from backports as a policy

this keeps backports installed by default (begrudgingly) however. it just allows disabling it.

it also allows disabling volatile in ubuntu, which wasn't possible before.

See merge request !16
This commit is contained in:
Jerome Charaoui 2015-06-09 15:49:02 +00:00
commit 58cfaa32f9
4 changed files with 16 additions and 8 deletions

View file

@ -7,6 +7,7 @@ class apt(
$codename = $apt::params::codename,
$use_lts = $apt::params::use_lts,
$use_volatile = $apt::params::use_volatile,
$use_backports = $apt::params::use_backports,
$include_src = $apt::params::include_src,
$use_next_release = $apt::params::use_next_release,
$debian_url = $apt::params::debian_url,

View file

@ -2,6 +2,7 @@ class apt::params () {
$codename = $::lsbdistcodename
$use_lts = false
$use_volatile = false
$use_backports = true
$include_src = false
$use_next_release = false
$debian_url = 'http://httpredir.debian.org/debian/'

View file

@ -19,14 +19,16 @@ deb-src <%= security_url %> <%= codename %>/updates <%= lrepos %>
# There is no security support for <%= release %>
<% end -%>
<% if use_backports=scope.lookupvar('apt::use_backports') -%>
# backports
<% if (release == "testing" || release == "unstable" || release == "experimental") -%>
<% if (release == "testing" || release == "unstable" || release == "experimental") -%>
# There is no backports archive for <%= release %>
<% else -%>
<% else -%>
deb <%= backports_url=scope.lookupvar('apt::backports_url') %> <%= codename %>-backports <%= lrepos %>
<% if include_src -%>
<% if include_src -%>
deb-src <%= backports_url %> <%= codename %>-backports <%= lrepos %>
<% end
<% end
end
end -%>
<% if use_volatile=scope.lookupvar('apt::use_volatile') -%>

View file

@ -7,11 +7,13 @@ deb <%= ubuntu_url=scope.lookupvar('apt::ubuntu_url') %> <%= codename %> <%= lre
deb-src <%= ubuntu_url %> <%= codename %> <%= lrepos %>
<% end -%>
<% if use_volatile=scope.lookupvar('apt::use_volatile') -%>
# updates
deb <%= ubuntu_url %> <%= codename %>-updates <%= lrepos %>
<% if include_src -%>
<% if include_src -%>
deb-src <%= ubuntu_url %> <%= codename %>-updates <%= lrepos %>
<% end -%>
<% end
end -%>
# security suppport
deb <%= ubuntu_url %> <%= codename %>-security <%= lrepos %>
@ -19,8 +21,10 @@ deb <%= ubuntu_url %> <%= codename %>-security <%= lrepos %>
deb-src <%= ubuntu_url %> <%= codename %>-security <%= lrepos %>
<% end -%>
<% if use_backports=scope.lookupvar('apt::use_backports') -%>
# backports
deb <%= ubuntu_url %> <%= codename %>-backports <%= lrepos %>
<% if include_src -%>
<% if include_src -%>
deb-src <%= ubuntu_url %> <%= codename %>-backports <%= lrepos %>
<% end -%>
<% end
end -%>