[chef] Re: Re: Why does package resource not understand source packages?


Chronological Thread 
  • From: andi abes < >
  • To: " " < >
  • Subject: [chef] Re: Re: Why does package resource not understand source packages?
  • Date: Wed, 23 Jan 2013 00:28:03 -0500




On Tue, Jan 22, 2013 at 11:02 PM, Adam Jacob < " target="_blank"> > wrote:
On 1/22/13 5:33 PM, "Jay Pipes" < "> > wrote:
>I'm wondering why if I do this:
>
>package "mypackage" do
>    source "/path/to/my/package.deb"
>end
>
>that the package resource cannot figure out to use the Dpkg provider to
>install the package?
>
>Instead, I get an error about no version specified and no candidate
>version available:
>
>http://paste.openstack.org/show/29738/
>
>If I change package to dpkg_package, it works correctly, but I was
>hoping the generic package resource would handle this based on the file
>extension...

No mas. The way Chef works is to map a default provider to the platform
you are on, not to any other magic (like file extension.) You can, as you
correctly surmised, use dpkg_package, or specify the provider with the
provider meta-param.


Thing is that this would make the recipe platform specific. As folks pointed out, on other the same provider can handle both local files and repos.

It would be really nice if there's a way to, e.g. provide the installation source (e.g. from environment / platform attribute) and have chef magic figure out how to manifest that on the node.

e.g [1]. but rather than just package name, pass in file, and have it do "The Right Thing" on different platforms. I'm potentially extending Jay's original request..



 
 
Best,
Adam






Archive powered by MHonArc 2.6.16.

§