module-apt/manifests/preferences_snippet.pp

35 lines
857 B
ObjectPascal
Raw Normal View History

define apt::preferences_snippet(
2010-10-17 14:13:02 +02:00
$ensure = 'present',
$source = '',
2010-10-17 14:13:02 +02:00
$release,
2010-12-07 19:18:41 +01:00
$priority )
{
if $custom_preferences == false {
fail("Trying to define a preferences_snippet with \$custom_preferences set to false.")
}
2010-10-17 14:29:01 +02:00
include apt::preferences
concat::fragment{"apt_preference_${name}":
ensure => $ensure,
target => '/etc/apt/preferences',
}
# This should really work in the same manner as sources_list and apt_conf
# snippets, but since the preferences.d directory cannot be used in Debian
# lenny, we can't generalize without going into ugly special-casing.
case $source {
'': {
2011-08-05 11:12:29 +02:00
Concat::Fragment["apt_preference_${name}"]{
content => template("apt/preferences_snippet.erb")
}
}
default: {
2011-08-05 11:12:29 +02:00
Concat::Fragment["apt_preference_${name}"]{
source => $source
}
}
}
}