[chef] Re: Re: Re: Re: Problem While Installing Linux Package with Chef


Chronological Thread 
  • From: Kandarp Desai < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Problem While Installing Linux Package with Chef
  • Date: Mon, 24 Oct 2011 13:54:49 -0700

I'm expecting Chef to use "yum".

I have other machine which is using chef "0.10.0" and the same code works fine on that machine.
The machine which is having this problem is running chef "0.10.4".
Is there any major change between this two versions which could cause this issue?

I don't mind downgrading to 0.10.0 temporarily. Also, I don't want to use manual installation as I have many recipes using 50-60 packages installation.

-KD

On Mon, Oct 24, 2011 at 1:29 PM, AJ Christensen < "> > wrote:
On 25 October 2011 09:10, Kandarp Desai < "> > wrote:
> It's on Oracle Linux 6.1

I don't think anyone has used Chef on Oracle Linux.

What package manager are you expecting Chef to use?

There's no mapping for providers for Oracle linux in the platform hash [0]

You'll have to expliclity tell Chef which provider you'll want to use
for resources, or adjust the platform hash yourself. This is very
heavy stuff. I'd suggesting opening a ticket for Oracle support and
figuring out what you need to complete to make that happen?

https://github.com/opscode/chef/blob/master/chef/lib/chef/platform.rb

In the mean time, you can use something like:

gem_package
yum_package
dpkg_package

And so on. Conversely, you can specify the provider in the package
definition itself:

package "foo" do
 provider Chef::Providers::Package::Yum
 action :upgrade
end

–AJ

> My recipe Code Looks like this:
> =====================
> scope = self
> packages = value_for_platform(
>     ["centos","redhat","fedora"] =>
>         {"default" => ["gcc", "gcc-c++", "openssl-devel", "pcre-devel",
> "zlib-devel"]},
>     "default" => ["gcc", "gcc-c++", "openssl-devel", "pcre-devel",
> "zlib-devel"]
>   )
> packages.each do |dev_pkg|
>   package dev_pkg
> end
> =========================
> Here's the Debug Output:
> ==============================
> Mon, 24 Oct 2011 13:15:39 +0000] ERROR: package[gcc]
> (/opt/hylocal/conf/chef/solo/cookbooks/nginx/recipes/test.rb:10:in
> `from_file') had an error:
> package[gcc] (nginx::test line 10) had an error: You must override
> load_current_resource in #<Chef::Provider::Package:0x7f72880eec80>
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/provider.rb:51:in
> `load_current_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource.rb:436:in
> `run_action'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:45:in
> `run_action'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in
> `each'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:81:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection.rb:94:in
> `execute_each_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
> `call'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
> `call_iterator_block'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in
> `step'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in
> `iterate'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in
> `each_with_index'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/resource_collection.rb:92:in
> `execute_each_resource'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/runner.rb:76:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:312:in
> `converge'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/client.rb:160:in
> `run'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/solo.rb:192:in
> `run_application'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/solo.rb:183:in
> `loop'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application/solo.rb:183:in
> `run_application'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/../lib/chef/application.rb:67:in
> `run'
> /usr/lib/ruby/gems/1.8/gems/chef-0.10.4/bin/chef-solo:25
> /usr/bin/chef-solo:19:in `load'
> /usr/bin/chef-solo:19
> ==================================================
> Thanks.
> -KD
> On Mon, Oct 24, 2011 at 12:56 PM, AJ Christensen < "> > wrote:
>>
>> What platform?
>>
>> Post your recipe code + debug output from Chef.
>>
>> –AJ
>>
>> On 25 October 2011 08:54, Kandarp Desai < "> > wrote:
>> >
>> > Hello,
>> > I've been using chef for a couple of months now.
>> > It's been running fine since yesterday. Suddenly, it started giving me
>> > error
>> > when I Install any linux package.. e.g. when I install gcc package, chef
>> > throws exception: "Chef::Exceptions::Override - package[gcc], You must
>> > override load_current_resource
>> > in #<Chef::Provider::Package:0x7f3eb5e24fa0>"
>> > ..
>> > is this known issue ?
>> > Can someone please help me ?
>> > -KD
>> >
>
>




Archive powered by MHonArc 2.6.16.

§