summaryrefslogtreecommitdiff
path: root/manifests
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2012-12-05 13:46:23 -0500
committerMicah Anderson <micah@riseup.net>2012-12-05 13:46:23 -0500
commit07a031f2050deecfefa205e1e0c63586692a06ff (patch)
tree280c615d47a615063c0ea613dd042358e56b7314 /manifests
parent460c1d54d1d04c1dd648d60a0b10f473d801f9b8 (diff)
fix for $lsbdistcodename regression introduced by ac166366d7baa45b74e09974289d9fb2dad38e67
What happened here was the $codename = $::lsbdistcodename was removed from init.pp and replaced with just $::lsbdistcodename whereever $codename was used. Then in the sources.list.erb and preferences files things were changed like this: <pre>+### Debian current: <%= codename = scope.lookupvar('::lsbdistcodename') %> ... -deb <%= debian_url %> <%= codename %> <%= repos %> ... +deb <%= debian_url=scope.lookupvar('apt::debian_url') %> <%= codename %> <%= repos=scope.lookupvar('apt::repos') %> </pre> This meant that the codename was always set to lsbdistcodename, and you because in newer puppet versions you cannot assign a value to a top-level facter variable, it is not possible to change this. Because we cannot change $lsbdistcodename, we have to fix this by allowing the user to pass a different, non-top-level scoped variable to the class as a parameter, which defaults to $::lsbdistcodename, so that upgrades can be triggered. This is documented in the README in an upgrade notice
Diffstat (limited to 'manifests')
-rw-r--r--manifests/init.pp10
-rw-r--r--manifests/preferences.pp4
2 files changed, 8 insertions, 6 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 509b6d1..3de4d9e 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -4,6 +4,7 @@
# See LICENSE for the full license granted to you.
class apt(
+ $codename = '',
$use_volatile = false,
$include_src = false,
$use_next_release = false,
@@ -38,16 +39,17 @@ class apt(
include lsb
# init $release, $next_release, $codename, $next_codename, $release_version
- case $::lsbdistcodename {
+ case $codename {
'': {
+ $codename = $::lsbdistcodename
$release = $::lsbdistrelease
}
default: {
- $release = debian_release($::lsbdistcodename)
+ $release = debian_release($codename)
}
}
- $release_version = debian_release_version($::lsbdistcodename)
- $next_codename = debian_nextcodename($::lsbdistcodename)
+ $release_version = debian_release_version($codename)
+ $next_codename = debian_nextcodename($codename)
$next_release = debian_nextrelease($release)
file {
diff --git a/manifests/preferences.pp b/manifests/preferences.pp
index 8f532f8..e9a74ff 100644
--- a/manifests/preferences.pp
+++ b/manifests/preferences.pp
@@ -3,8 +3,8 @@ class apt::preferences {
concat::fragment{"apt_preferences_header":
content => $apt::custom_preferences ? {
'' => $::operatingsystem ? {
- 'debian' => template("apt/${::operatingsystem}/preferences_${::lsbdistcodename}.erb"),
- 'ubuntu' => template("apt/${::operatingsystem}/preferences_${::lsbdistcodename}.erb"),
+ 'debian' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"),
+ 'ubuntu' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"),
},
default => $custom_preferences
},