aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-03-05 15:19:07 -0300
committerSilvio Rhatto <rhatto@riseup.net>2013-03-05 15:19:07 -0300
commit5dcabc96816f248891d8fc1748a229a588a3eb45 (patch)
treea5f75984d223880723538588de2cdd10adeb7e0f
parent1ce5e27c4b25825b5c379d4f400cf5e44e5d3741 (diff)
parentf0a107ffeecaf968a8abcd51220d5e42b4b36095 (diff)
downloadpuppet-apt-5dcabc96816f248891d8fc1748a229a588a3eb45.tar.gz
puppet-apt-5dcabc96816f248891d8fc1748a229a588a3eb45.tar.bz2
Merge branch 'master' of ssh://labs.riseup.net/shared-apt
-rw-r--r--manifests/init.pp2
-rw-r--r--manifests/preferences_snippet.pp24
2 files changed, 16 insertions, 10 deletions
diff --git a/manifests/init.pp b/manifests/init.pp
index 9709adb..17d87c7 100644
--- a/manifests/init.pp
+++ b/manifests/init.pp
@@ -27,7 +27,7 @@ class apt(
}
'ubuntu': {
$real_repos = $repos ? {
- '' => 'main restricted universe multiverse',
+ 'auto' => 'main restricted universe multiverse',
default => $repos,
}
}
diff --git a/manifests/preferences_snippet.pp b/manifests/preferences_snippet.pp
index 0bff85c..5ae748b 100644
--- a/manifests/preferences_snippet.pp
+++ b/manifests/preferences_snippet.pp
@@ -1,5 +1,5 @@
define apt::preferences_snippet (
- $priority,
+ $priority = undef,
$package = false,
$ensure = 'present',
$source = '',
@@ -12,15 +12,21 @@ define apt::preferences_snippet (
default => $package,
}
- if $custom_preferences == false {
- fail('Trying to define a preferences_snippet with $custom_preferences set to false.')
- }
+ if $ensure == 'present' {
+ if $custom_preferences == false {
+ fail('Trying to define a preferences_snippet with $custom_preferences set to false.')
+ }
- if !$pin and !$release {
- fail('apt::preferences_snippet requires one of the \'pin\' or \'release\' argument to be set')
- }
- if $pin and $release {
- fail('apt::preferences_snippet requires either a \'pin\' or \'release\' argument, not both')
+ if $priority == undef {
+ fail('apt::preferences_snippet requires the \'priority\' argument to be set')
+ }
+
+ if !$pin and !$release {
+ fail('apt::preferences_snippet requires one of the \'pin\' or \'release\' argument to be set')
+ }
+ if $pin and $release {
+ fail('apt::preferences_snippet requires either a \'pin\' or \'release\' argument, not both')
+ }
}
file { "/etc/apt/preferences.d/${name}":