module-puppetlabs-apt/manifests/pin.pp

33 lines
630 B
ObjectPascal
Raw Normal View History

2010-04-27 22:38:28 +02:00
# pin.pp
# pin a release in apt, useful for unstable repositories
define apt::pin(
$ensure = present,
$packages = '*',
2012-04-28 02:23:48 +02:00
$priority = 0,
$release = '',
$origin = ''
2010-04-27 22:38:28 +02:00
) {
include apt::params
2010-04-27 22:38:28 +02:00
$preferences_d = $apt::params::preferences_d
if $release != '' {
$pin = "release a=${release}"
} elsif $origin != '' {
$pin = "origin \"${origin}\""
} else {
2012-05-22 00:03:30 +02:00
$pin = "release a=${name}"
}
file { "${name}.pref":
ensure => $ensure,
path => "${preferences_d}/${name}.pref",
owner => root,
group => root,
mode => '0644',
2012-05-21 23:49:30 +02:00
content => template("apt/pin.pref.erb"),
}
2010-04-27 22:38:28 +02:00
}