32 lines
630 B
Puppet
32 lines
630 B
Puppet
# pin.pp
|
|
# pin a release in apt, useful for unstable repositories
|
|
|
|
define apt::pin(
|
|
$ensure = present,
|
|
$packages = '*',
|
|
$priority = 0,
|
|
$release = '',
|
|
$origin = ''
|
|
) {
|
|
|
|
include apt::params
|
|
|
|
$preferences_d = $apt::params::preferences_d
|
|
|
|
if $release != '' {
|
|
$pin = "release a=${release}"
|
|
} elsif $origin != '' {
|
|
$pin = "origin \"${origin}\""
|
|
} else {
|
|
$pin = "release a=${name}"
|
|
}
|
|
|
|
file { "${name}.pref":
|
|
ensure => $ensure,
|
|
path => "${preferences_d}/${name}.pref",
|
|
owner => root,
|
|
group => root,
|
|
mode => '0644',
|
|
content => template("apt/pin.pref.erb"),
|
|
}
|
|
}
|