3 # This defined type allows you to hold a package based on the version you
4 # require. It's implemented by dropping an apt preferences file pinning the
5 # package to the version you require.
10 # The version at which you wish to pin a package.
12 # This can either be the full version, such as 4:2.11.8.1-5, or
13 # a partial version, such as 4:2.11.*
16 # _default_: +$title+, the title/name of the resource.
18 # Name of the package that apt is to hold.
23 # The default priority of 1001 causes this preference to always win. By
24 # setting the priority to a number greater than 1000 apt will always install
25 # this version even if it means downgrading the currently installed version.
33 validate_string($title)
34 validate_re($ensure, ['^present|absent',])
35 validate_string($package)
36 validate_string($version)
38 if ! is_integer($priority) {
39 fail('$priority must be an integer')
42 if $ensure == 'present' {
43 ::apt::pin { "hold ${package} at ${version}":
46 priority => $priority,
49 ::apt::pin { "hold ${package} at ${version}":