Merge remote-tracking branch 'lelutin-gitlab/backports_follow_debian_url' into shared-master
This commit is contained in:
commit
a875536532
5 changed files with 25 additions and 23 deletions
|
@ -49,6 +49,10 @@ Ubuntu support is lagging behind but not absent either.
|
||||||
|
|
||||||
## Upgrade Notice<a name="upgrade-notice"></a>
|
## Upgrade Notice<a name="upgrade-notice"></a>
|
||||||
|
|
||||||
|
* The default value of the `$repos` parameter was removed since the logic is
|
||||||
|
now in the `apt::params` class. If you have explicitly set `$repos` to
|
||||||
|
'auto' in your manifests, you should remove this.
|
||||||
|
|
||||||
* The `disable_update` parameter has been removed. The main apt class
|
* The `disable_update` parameter has been removed. The main apt class
|
||||||
defaults to *not* run an `apt-get update` on every run anyway so this
|
defaults to *not* run an `apt-get update` on every run anyway so this
|
||||||
parameter seems useless.
|
parameter seems useless.
|
||||||
|
|
|
@ -20,19 +20,10 @@ class apt(
|
||||||
$custom_sources_list = '',
|
$custom_sources_list = '',
|
||||||
$custom_key_dir = $apt::params::custom_key_dir
|
$custom_key_dir = $apt::params::custom_key_dir
|
||||||
) inherits apt::params {
|
) inherits apt::params {
|
||||||
case $::operatingsystem {
|
|
||||||
'debian': {
|
$real_backports_url = $backports_url ? {
|
||||||
$real_repos = $repos ? {
|
false => $debian_url,
|
||||||
'auto' => 'main contrib non-free',
|
default => $backports_url,
|
||||||
default => $repos,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
'ubuntu': {
|
|
||||||
$real_repos = $repos ? {
|
|
||||||
'auto' => 'main restricted universe multiverse',
|
|
||||||
default => $repos,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
package { 'apt':
|
package { 'apt':
|
||||||
|
@ -99,12 +90,12 @@ class apt(
|
||||||
if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) {
|
if ($use_backports and !($::debian_release in ['testing', 'unstable', 'experimental'])) {
|
||||||
apt::sources_list {
|
apt::sources_list {
|
||||||
'backports':
|
'backports':
|
||||||
content => "deb $backports_url ${::debian_codename}-backports ${apt::real_repos}",
|
content => "deb ${real_backports_url} ${::debian_codename}-backports ${apt::repos}",
|
||||||
}
|
}
|
||||||
if $include_src {
|
if $include_src {
|
||||||
apt::sources_list {
|
apt::sources_list {
|
||||||
'backports-src':
|
'backports-src':
|
||||||
content => "deb-src $backports_url ${::debian_codename}-backports ${apt::real_repos}",
|
content => "deb-src ${real_backports_url} ${::debian_codename}-backports ${apt::repos}",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,14 +9,21 @@ class apt::params () {
|
||||||
$ubuntu_url = 'http://archive.ubuntu.com/ubuntu'
|
$ubuntu_url = 'http://archive.ubuntu.com/ubuntu'
|
||||||
$backports_url = $::debian_codename ? {
|
$backports_url = $::debian_codename ? {
|
||||||
'squeeze' => 'http://backports.debian.org/debian-backports/',
|
'squeeze' => 'http://backports.debian.org/debian-backports/',
|
||||||
default => $::operatingsystem ? {
|
default => false,
|
||||||
'Ubuntu' => $ubuntu_url,
|
|
||||||
default => $debian_url,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$lts_url = $debian_url
|
$lts_url = $debian_url
|
||||||
$volatile_url = 'http://volatile.debian.org/debian-volatile/'
|
$volatile_url = 'http://volatile.debian.org/debian-volatile/'
|
||||||
$repos = 'auto'
|
case $::operatingsystem {
|
||||||
|
'debian': {
|
||||||
|
$repos = 'main contrib non-free'
|
||||||
|
}
|
||||||
|
'ubuntu': {
|
||||||
|
$repos = 'main restricted universe multiverse'
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
fail("Unsupported system '${::operatingsystem}'.")
|
||||||
|
}
|
||||||
|
}
|
||||||
$custom_preferences = ''
|
$custom_preferences = ''
|
||||||
$custom_key_dir = false
|
$custom_key_dir = false
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
### Debian current: <%= codename=scope.lookupvar('::debian_codename') %>
|
### Debian current: <%= codename=scope.lookupvar('::debian_codename') %>
|
||||||
|
|
||||||
# basic
|
# basic
|
||||||
deb <%= debian_url=scope.lookupvar('apt::debian_url') %> <%= codename %> <%= lrepos=scope.lookupvar('apt::real_repos') %>
|
deb <%= debian_url=scope.lookupvar('apt::debian_url') %> <%= codename %> <%= lrepos=scope.lookupvar('apt::repos') %>
|
||||||
<% if include_src=scope.lookupvar('apt::include_src') -%>
|
<% if include_src=scope.lookupvar('apt::include_src') -%>
|
||||||
deb-src <%= debian_url %> <%= codename %> <%= lrepos %>
|
deb-src <%= debian_url %> <%= codename %> <%= lrepos %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# This file is managed by puppet
|
# This file is managed by puppet
|
||||||
# all local modifications will be overwritten
|
# all local modifications will be overwritten
|
||||||
|
|
||||||
# basic <%= codename=scope.lookupvar('::ubuntu_codename') %>
|
# basic <%= codename=scope.lookupvar('apt::codename') %>
|
||||||
deb <%= ubuntu_url=scope.lookupvar('apt::ubuntu_url') %> <%= codename %> <%= lrepos=scope.lookupvar('apt::real_repos') %>
|
deb <%= ubuntu_url=scope.lookupvar('apt::ubuntu_url') %> <%= codename %> <%= lrepos=scope.lookupvar('apt::repos') %>
|
||||||
<% if include_src=scope.lookupvar('apt::include_src') -%>
|
<% if include_src=scope.lookupvar('apt::include_src') -%>
|
||||||
deb-src <%= ubuntu_url %> <%= codename %> <%= lrepos %>
|
deb-src <%= ubuntu_url %> <%= codename %> <%= lrepos %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
Loading…
Reference in a new issue