From 48bf4a390e7fc2d7fa948ca1c441785880f4c22b Mon Sep 17 00:00:00 2001 From: Jerome Charaoui Date: Wed, 7 Oct 2015 10:36:12 -0400 Subject: Merge Debian squeeze, wheezy, jessie and sid preferences templates into one --- manifests/preferences.pp | 5 ++++- templates/Debian/preferences.erb | 33 ++++++++++++++++++++++++++++++++ templates/Debian/preferences_jessie.erb | 14 -------------- templates/Debian/preferences_sid.erb | 10 ---------- templates/Debian/preferences_squeeze.erb | 30 ----------------------------- templates/Debian/preferences_wheezy.erb | 20 ------------------- 6 files changed, 37 insertions(+), 75 deletions(-) create mode 100644 templates/Debian/preferences.erb delete mode 100644 templates/Debian/preferences_jessie.erb delete mode 100644 templates/Debian/preferences_sid.erb delete mode 100644 templates/Debian/preferences_squeeze.erb delete mode 100644 templates/Debian/preferences_wheezy.erb diff --git a/manifests/preferences.pp b/manifests/preferences.pp index 9ed24c1..50ca23a 100644 --- a/manifests/preferences.pp +++ b/manifests/preferences.pp @@ -2,7 +2,10 @@ class apt::preferences { $pref_contents = $apt::custom_preferences ? { '' => $::operatingsystem ? { - 'debian' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"), + 'debian' => $::debian_codename ? { + 'lenny' => template("apt/${::operatingsystem}/preferences_lenny.erb"), + default => template("apt/${::operatingsystem}/preferences.erb"), + }, 'ubuntu' => template("apt/${::operatingsystem}/preferences_${apt::codename}.erb"), }, default => $apt::custom_preferences diff --git a/templates/Debian/preferences.erb b/templates/Debian/preferences.erb new file mode 100644 index 0000000..37cf80d --- /dev/null +++ b/templates/Debian/preferences.erb @@ -0,0 +1,33 @@ +# This file is managed by puppet +# all local modifications will be overwritten + +Explanation: Debian <%= codename=scope.lookupvar('::debian_codename') %> +Package: * +Pin: release o=Debian,n=<%= codename %> +Pin-Priority: 990 + +<% if use_volatile=scope.lookupvar('apt::use_volatile') -%> +Explanation: Debian <%= codename %>-updates +Package: * +Pin: release o=Debian,n=<%= codename %>-updates +Pin-Priority: 990 +<%- end -%> + +<% if (use_lts=scope.lookupvar('apt::use_lts')) && (scope.lookupvar('::debian_lts') == "true") -%> +Explanation: Debian <%= codename %>-lts +Package: * +Pin: release o=Debian,n=<%= codename %>-lts +Pin-Priority: 990 +<%- end -%> + +<% if (next_codename=scope.lookupvar('::debian_nextcodename')) && (next_codename != "experimental") -%> +Explanation: Debian <%= next_codename %> +Package: * +Pin: release o=Debian,n=<%= next_codename %> +Pin-Priority: 2 +<%- end -%> + +Explanation: Debian fallback +Package: * +Pin: release o=Debian +Pin-Priority: -10 diff --git a/templates/Debian/preferences_jessie.erb b/templates/Debian/preferences_jessie.erb deleted file mode 100644 index 4f8e95c..0000000 --- a/templates/Debian/preferences_jessie.erb +++ /dev/null @@ -1,14 +0,0 @@ -Explanation: Debian <%= codename=scope.lookupvar('apt::codename') %> -Package: * -Pin: release o=Debian,n=<%= codename %> -Pin-Priority: 990 - -Explanation: Debian sid -Package: * -Pin: release o=Debian,n=sid -Pin-Priority: 1 - -Explanation: Debian fallback -Package: * -Pin: release o=Debian -Pin-Priority: -10 diff --git a/templates/Debian/preferences_sid.erb b/templates/Debian/preferences_sid.erb deleted file mode 100644 index eb18554..0000000 --- a/templates/Debian/preferences_sid.erb +++ /dev/null @@ -1,10 +0,0 @@ -Explanation: Debian sid -Package: * -Pin: release o=Debian,n=sid -Pin-Priority: 990 - -Explanation: Debian fallback -Package: * -Pin: release o=Debian -Pin-Priority: -10 - diff --git a/templates/Debian/preferences_squeeze.erb b/templates/Debian/preferences_squeeze.erb deleted file mode 100644 index 838b3a1..0000000 --- a/templates/Debian/preferences_squeeze.erb +++ /dev/null @@ -1,30 +0,0 @@ -Explanation: Debian <%= codename=scope.lookupvar('apt::codename') %> -Package: * -Pin: release o=Debian,n=<%= codename %> -Pin-Priority: 990 - -Explanation: Debian <%= codename %>-updates -Package: * -Pin: release o=Debian,n=<%= codename %>-updates -Pin-Priority: 990 - -Explanation: Debian <%= codename %>-lts -Package: * -Pin: release o=Debian,n=<%= codename %>-lts -Pin-Priority: 990 - -Explanation: Debian <%= next_codename=scope.lookupvar('apt::next_codename') %> -Package: * -Pin: release o=Debian,n=<%= next_codename %> -Pin-Priority: 2 - -Explanation: Debian sid -Package: * -Pin: release o=Debian,n=sid -Pin-Priority: 1 - -Explanation: Debian fallback -Package: * -Pin: release o=Debian -Pin-Priority: -10 - diff --git a/templates/Debian/preferences_wheezy.erb b/templates/Debian/preferences_wheezy.erb deleted file mode 100644 index 0cc0e5c..0000000 --- a/templates/Debian/preferences_wheezy.erb +++ /dev/null @@ -1,20 +0,0 @@ -Explanation: Debian <%= codename=scope.lookupvar('apt::codename') %> -Package: * -Pin: release o=Debian,n=<%= codename %> -Pin-Priority: 990 - -Explanation: Debian <%= codename %>-updates -Package: * -Pin: release o=Debian,n=<%= codename %>-updates -Pin-Priority: 990 - -Explanation: Debian sid -Package: * -Pin: release o=Debian,n=sid -Pin-Priority: 1 - -Explanation: Debian fallback -Package: * -Pin: release o=Debian -Pin-Priority: -10 - -- cgit v1.2.3