aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifests/preferences_snippet.pp7
-rw-r--r--templates/preferences_snippet.erb2
-rw-r--r--templates/preferences_snippet_release.erb2
3 files changed, 8 insertions, 3 deletions
diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp
index e00c4d1..6a8e6bc 100644
--- a/manifests/preferences_snippet.pp
+++ b/manifests/preferences_snippet.pp
@@ -1,5 +1,5 @@
define apt::preferences_snippet(
- $package = $name,
+ $package = false,
$ensure = 'present',
$source = '',
$release = '',
@@ -7,6 +7,11 @@ define apt::preferences_snippet(
$priority )
{
+ $real_package = $package ? {
+ false => $name,
+ default => $package,
+ }
+
if $custom_preferences == false {
fail("Trying to define a preferences_snippet with \$custom_preferences set to false.")
}
diff --git a/templates/preferences_snippet.erb b/templates/preferences_snippet.erb
index fd15ce6..b7acaab 100644
--- a/templates/preferences_snippet.erb
+++ b/templates/preferences_snippet.erb
@@ -1,4 +1,4 @@
-Package: <%= package %>
+Package: <%= real_package %>
Pin: <%= pin %>
Pin-Priority: <%= priority %>
diff --git a/templates/preferences_snippet_release.erb b/templates/preferences_snippet_release.erb
index 0c4e136..845d23f 100644
--- a/templates/preferences_snippet_release.erb
+++ b/templates/preferences_snippet_release.erb
@@ -1,4 +1,4 @@
-Package: <%= package %>
+Package: <%= real_package %>
Pin: release a=<%= release %>
Pin-Priority: <%= priority %>