summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/puppet/parser/functions/debian_release_version.rb9
-rw-r--r--manifests/init.pp3
-rw-r--r--templates/Debian/preferences_lenny.erb2
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/puppet/parser/functions/debian_release_version.rb b/lib/puppet/parser/functions/debian_release_version.rb
new file mode 100644
index 0000000..4b135d0
--- /dev/null
+++ b/lib/puppet/parser/functions/debian_release_version.rb
@@ -0,0 +1,9 @@
+module Puppet::Parser::Functions
+ newfunction(:debian_release_version, :type => :rvalue) do |args|
+ case args[0]
+ when 'etch' then '4.0'
+ when 'lenny' then '5.0'
+ else ''
+ end
+ end
+end
diff --git a/manifests/init.pp b/manifests/init.pp
index 2d46ad4..7fa811d 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -62,7 +62,7 @@ class apt {
include lsb
- # init $release, $next_release, $codename, $next_codename
+ # init $release, $next_release, $codename, $next_codename, $release_version
case $lsbdistcodename {
'': {
$codename = $lsbdistcodename
@@ -73,6 +73,7 @@ class apt {
$release = debian_release($codename)
}
}
+ $release_version = debian_release_version($codename)
$next_codename = debian_nextcodename($codename)
$next_release = debian_nextrelease($release)
diff --git a/templates/Debian/preferences_lenny.erb b/templates/Debian/preferences_lenny.erb
index be8ecd8..dda2d7a 100644
--- a/templates/Debian/preferences_lenny.erb
+++ b/templates/Debian/preferences_lenny.erb
@@ -1,6 +1,6 @@
Explanation: Debian <%= codename %>
Package: *
-Pin: release o=Debian,a=<%= release %>
+Pin: release o=Debian,a=<%= release %>,v=<%= release_version %>*
Pin-Priority: 990
Explanation: Debian backports