Issue #13254 has been updated by Jeff Weiss.

I'm using puppet 2.7.12, installed from yum.puppetlabs.com.


I did a quick test with epel-release-6-5.noarch.rpm.

This works:
<code>
<pre>
yum install epel-release-6-5.noarch.rpm
</pre>
</code>

but when I put it in a manifest, it fails:
<code>
<pre>
package { 'epel-release':
  ensure => installed,
  source => 'file:///root/epel-release-6-5.noarch.rpm'
}
</pre>
</code>

Here are the debug statements from running puppet apply -d 13254.pp
<code>
<pre>
   ... snip ...

debug: Prefetching yum resources for package
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm --version'
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -qa 
--nosignature --nodigest --qf '%{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
%{RELEASE} %{ARCH}
''
debug: Puppet::Type::Package::ProviderYum: Executing '/bin/rpm -q epel-release 
--nosignature --nodigest --qf %{NAME} %|EPOCH?{%{EPOCH}}:{0}| %{VERSION} 
%{RELEASE} %{ARCH}
'
debug: Package[epel-release](provider=yum): Ensuring => present
debug: Puppet::Type::Package::ProviderYum: Executing '/usr/bin/yum -d 0 -e 0 -y 
install epel-release'
err: /Stage[main]//Package[epel-release]/ensure: change from absent to present 
failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install epel-release' returned 
1: Error: Nothing to do
</pre>
</code>
----------------------------------------
Bug #13254: default package provider doesn't respect source parameter
https://projects.puppetlabs.com/issues/13254#change-58441

Author: Jeff Weiss
Status: Unreviewed
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected Puppet version: 
Keywords: 
Branch: 


The default package provider on CentOS doesn't use the source parameter.

I have a manifest that contains this:
<code>
<pre>
package { 'graphite-web':
  ensure => installed,
  source => 'file:///root/manifests/source/graphite-web-0.9.9-1.noarch.rpm',
}
</pre>
</code>

It's a system package; I'm telling Puppet where to get it; I expect the 
manifest to work. It doesn't.

As a user (maybe just as a noob), I would expect that since the package is a 
system type of package (i.e. rpm), I shouldn't need to explicitly specify the 
provider.  If I must, then as a user, I must know the implementation details 
that for system packages (implicit/provider-less) Puppet will only try the yum 
provider even though it can't handle the source parameter (or at least a source 
parameter containing a URI).

Here's the logic for how I think it should work:
<pre>
 no provider && no source => system package, use default [yum on CentOS]
 no provider && source => system package,  use (default.supports_source? ? 
default : URI supportable system package command [rpm on CentOS])
</pre>
This works:
<code>
<pre>
package { 'graphite-web':
  ensure => installed,
  provider => 'rpm',
  source => 'file:///root/manifests/source/graphite-web-0.9.9-1.noarch.rpm',
}
</pre>
</code>
But I feel like we needn't explicitly include provider.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to