David's advice is unfortunately un-sound. You do not normally need to use the "name" parameter with the 'yum' package provider, because yum normally uses the package name as the desired RPM name. That is, simply:
package { 'my-package-name':
ensure => 'installed',
}Note that that's normally just the
package name as it will be recorded in the RPM database, not the RPM filename. But that only works if the specified package is in one of the yum package repositories that your system is already configured to use. Your objective here appears to be to configure a package repository that may not already be configured, and for that you cannot use the 'yum' provider at all -- it's simply not the way Yum works.
If you want to manage an RPM package from a specific local or http[s]
source that you specify, then you need to ensure that the 'rpm' provider be used. On most systems that use RPMs, the default provider is
something more flexible, such as 'yum', so you need to declare the
'rpm' provider specifically if you want to use it (i.e. what Mark wrote). Note also Jonathan's
comments about package dependencies, which are the reason other
providers are preferred to the plain 'rpm' provider for most purposes. Dependencies should not be an issue for your particular case, so probably this will work:
package { 'puppetlabs-release':
ensure => 'installed',
source => 'https://yum.puppetlabs.com/el/6/products/x86_64/puppetlabs-release-6-5.noarch.rpm',
provider => 'rpm'
}John