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