Im not sure if you saw this resource or not but if you are specifically using yum you can use the 'yum_package' resource and that allows yum options to be passed to it.
http://docs.opscode.com/resource_yum.html
Justin
-----Original Message-----
From: "Kevin Keane Subscription" <
>
Sent: Wednesday, March 27, 2013 9:07pm
To: "
" <
>
Subject: [chef] RE: possible to pass options to yum on package install
I’ve had a similar situation where I needed *one* package out of repoforge, but it created dependency hell everywhere else. My solution was to create my own local repository (and I’m using a chef cookbook to set up this repository). For me, it particularly made sense because I also have a couple RPMs that I need but aren’t in available in any public repo at all.
I haven’t yet figured out a way to keep these RPMs updated automatically, though.
From: Jeremy Koerber [mailto:
Sent: Wednesday, March 27, 2013 2:39 PM
To:
Subject: [chef] possible to pass options to yum on package install
Hi,
I have this in a recipe:
package "tomcat7" do
action :install
options "--enablerepo=amzn-main"
end
but the options are not being passed to yum and the package fails to install because it isn't found in my regular yum repos that are enabled by default. I can't enable the amzn-main repo by default because then the system starts using it for everything, and I end up with some messy dependency conflicts. Plus, I strongly prefer to just use the CentOS-Base repo wherever possible.
So.. Looking at http://docs.opscode.com/resource_package.html and I see:
options Additional options that are added to the underlying package command. Can be used with APT, dpkg, Gentoo, RPM Package Manager, and RubyGems. Default value: nil.
So that would explain why Yum isn't getting the options passed to it. So my questions are: is there a way to do this, and why can't chef pass options to yum just like APT?
Thanks much for any help..
Jeremy
Archive powered by MHonArc 2.6.16.