0fb5f78379
When the name is used with a file resource, it becomes difficult to test the resource using rspec-puppet, as the name parameter gets aliased to path. So to maintain consistency between tests and manifests, this replaces all name parameters in file resources with the equivalent path parameter.
19 lines
412 B
Puppet
19 lines
412 B
Puppet
# pin.pp
|
|
# pin a release in apt, useful for unstable repositories
|
|
|
|
define apt::pin(
|
|
$packages = '*',
|
|
$priority = 0
|
|
) {
|
|
|
|
include apt::params
|
|
|
|
file { "${name}.pref":
|
|
path => "${apt::params::root}/preferences.d/${name}",
|
|
ensure => file,
|
|
owner => root,
|
|
group => root,
|
|
mode => 644,
|
|
content => "# ${name}\nPackage: ${packages}\nPin: release a=${name}\nPin-Priority: ${priority}",
|
|
}
|
|
}
|