module-puppetlabs-apt/manifests/pin.pp
Matthaus Litteken 0fb5f78379 (#12094) Replace name with path in file resources
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.
2012-01-23 13:25:52 -08:00

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}",
}
}