[PUP-1927] Yum Package Provider Ignores Source Parameter Created: 2014/03/13  Updated: 2020/03/04

Status: Accepted
Project: Puppet
Component/s: Types and Providers
Affects Version/s: PUP 3.4.3
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Christopher Barbour Assignee: Unassigned
Resolution: Unresolved Votes: 5
Labels: el, fileserver, package, platform-os, rpm, source, type_and_provider, yum
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Team: Night's Watch
QA Contact: Narmadha Perumal


The YUM provider for the package type ignores the source parameter, and instead uses the name parameter for all package installation tasks. This behavior is somewhat inconsistent with other providers for this resource type.

For example, with the RPM provider, the name parameter is compared against the packages instances list. If the defined package is not installed but should be, the provider will then download the package supplied by the source parameter and install it.

With the yum provider, in the same conditions, puppet will kick off a yum installation of the named package, not the package supplied by the source parameter. This is okay if the desired package happens to be in a configured yum repository, but not so great otherwise.

YUM fully supports installation from a source path; on older releases using the localinstall command, and on newer systems using the install command.

This behavior is useful for multi-platform support and for module testing. In testing, I may wish to pass a explicit source for a package, without overriding the native provider on RHEL and derivative systems. It's also useful since YUM will still manage dependencies, even when supplied with a source URL.

This also ensures that the documented behavior of the YUM provider matches the actual behavior.

Comment by Marco Rodrigues [ 2016/06/27 ]

We are in the version 4 of Puppet and this is still not supported.

   package { "puppet-agent":
        provider => 'yum',
        ensure   => 'latest',
        source   => "puppet:///modules/${module_name}/puppet-agent-1.5.2-1.el7.x86_64.rpm"

Generated at Sun Sep 27 16:08:41 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.