# Trouble with yum\_package options

**URL:** <https://discourse.chef.io/t/trouble-with-yum-package-options/3083>\
**Category:** Chef Infra (archive)\
**Created:** [August 5, 2012, 3:21pm UTC](https://discourse.chef.io/t/trouble-with-yum-package-options/3083 "2012-08-05T15:21:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![David\_Petzel](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/david_petzel/32/38_2.png) [@David\_Petzel](https://discourse.chef.io/u/David_Petzel)\
**Post date:** [August 5, 2012, 3:21pm UTC](https://discourse.chef.io/t/trouble-with-yum-package-options/3083/1 "2012-08-05T15:21:28Z")

</div>

So I think this might be a variant of  
[http://lists.opscode.com/sympa/arc/chef/2012-01/msg00457.html](http://lists.opscode.com/sympa/arc/chef/2012-01/msg00457.html).

I am trying to do the following:  
yum\_package “rrdtool” do  
version "1.4.7-1.el6.rfx"  
options "–enablerepo=rpmforge-extras"  
end

I have the rpmforge repo setup, but set to disabled. The error I get is:  
“Chef::Exceptions:📦 Version 1.4.7-1.el6.rfx of rrdtool not found. Did  
you specify both version and release? (version-release, e.g. 1.84-10.fc6)”

If I run yum from the command line using `yum install rrdtool-1.4.7-1.el6.rfx --enablerepo=rpmforge-extras` the package shows as available for installation

Additional if I flip the enabled=0 to enabled=1 in the .repo file for  
repoforge, the chef run sees and installs the package correctly.

Here is the debug level output of the failure

[2012-08-05T17:17:33+02:00] DEBUG: Processing yum\_package[rrdtool] on localhost  
[2012-08-05T17:17:33+02:00] INFO: Processing yum\_package[rrdtool] action  
install (zenoss::server4 line 38)  
[2012-08-05T17:17:37+02:00] DEBUG: yum\_package[rrdtool] checking yum info for  
rrdtool-1.4.7-1.el6.rfx  
[2012-08-05T17:17:37+02:00] DEBUG: yum\_package[rrdtool] installed version:  
(none) candidate version: 1.3.8-6.el6  
[2012-08-05T17:17:37+02:00] ERROR: yum\_package[rrdtool] (cookbook::recipe line  
38) has had an error

From that output, I got as far as  
[https://github.com/opscode/chef/blob/master/chef/lib/chef/provider/package/yum.rb#L1041](https://github.com/opscode/chef/blob/master/chef/lib/chef/provider/package/yum.rb#L1041),  
and near as I can figure out, the options passed to the resource are honored  
at install time, but _not_ during candidate determination.

I see the options used in the install method here:  
[https://github.com/opscode/chef/blob/master/chef/lib/chef/provider/package/yum.rb#L1056](https://github.com/opscode/chef/blob/master/chef/lib/chef/provider/package/yum.rb#L1056)

but I can’t seem to determine how the candidate election code works, or if the  
options are honored or not, but it would seem they are not.

Am I crazy here, or might this be a bug, or do I just need to go about this in  
a different way?

Thanks
