- From: AJ Christensen <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Problem While Installing Linux Package with Chef
- Date: Tue, 25 Oct 2011 13:37:37 +1300
The full resource form:
pacakge "iptables" do
provider Chef::Providers::Package::Yum
end
–AJ
On 25 October 2011 13:35, Kandarp Desai
<
>
wrote:
>
Thanks a lot, Joshua. I will file ticket tonight.
>
Also, How do do add provider parameter to package if it's name of the
>
package.
>
e.g. for iptables package, in recipe file, first line is "package
>
"iptables" "
>
If I add , provider Chef::Providers::Package, it's not working.
>
What should I use in this case ? So, I won't be blocked by this error.
>
Cheers,
>
KD
>
On Mon, Oct 24, 2011 at 4:49 PM, Joshua Timberman
>
<
>
>
wrote:
>
>
>
> Hi there!
>
>
>
> The root of the problem is that the tool Chef uses to detect
>
> information about the node it is running on, Ohai, does not have a
>
> plugin to properly detect Oracle Linux. This will affect four
>
> resources:
>
>
>
> cron
>
> mdadm
>
> package
>
> service
>
>
>
> When you have recipes that use any of these recipes, you'll probably
>
> need to add the "provider" parameter to these resources so they work
>
> on Oracle Linux.
>
>
>
> We'd like to correct the problem, though. Please open a ticket at
>
> tickets.opscode.com in the OHAI project to add support for Oracle
>
> Linux. If there's an /etc/redhat-release, please include its contents
>
> in the ticket.
>
>
>
>
>
>
>
> On Mon, Oct 24, 2011 at 4:37 PM, Kandarp Desai
>
> <
>
>
> wrote:
>
> >
>
> > I used
>
> > package "foo" do
>
> > provider Chef::Providers::Package::Yum
>
> > action :upgrade
>
> > end
>
> > which solved the problem.
>
> > But, now I'm facing same error for iptables recipe. I'm have download
>
> > iptables recipe from opscode site.
>
> > Just like before, it's been running fine till now. Suddenly, it's
>
> > throwing me following error:
>
> > =============================================================
>
> > Mon, 24 Oct 2011 15:14:47 +0000] DEBUG: Re-raising exception:
>
> > Chef::Exceptions::Override - package[iptables] (iptables::default line
>
> > 20)
>
> > had an error: You must override load_current_resource in
>
> > #<Chef::Provider::Package:0x7f7b8a1a0588>
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/provider.rb:51:in
>
> > `load_current_resource'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource.rb:416:in
>
> > `run_action'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:45:in
>
> > `run_action'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in
>
> > `converge'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in
>
> > `each'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:78:in
>
> > `converge'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection.rb:94:in
>
> > `execute_each_resource'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
>
> > `call'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:116:in
>
> > `call_iterator_block'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:85:in
>
> > `step'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:104:in
>
> > `iterate'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection/stepable_iterator.rb:55:in
>
> > `each_with_index'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/resource_collection.rb:92:in
>
> > `execute_each_resource'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/runner.rb:76:in
>
> > `converge'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:312:in
>
> > `converge'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/client.rb:160:in
>
> > `run'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:192:in
>
> > `run_application'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:in
>
> > `loop'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application/solo.rb:183:in
>
> > `run_application'
>
> >
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/../lib/chef/application.rb:66:in
>
> > `run'
>
> > /usr/lib/ruby/gems/1.8/gems/chef-0.10.0/bin/chef-solo:25
>
> > /usr/bin/chef-solo:19:in `load'
>
> > /usr/bin/chef-solo:19
>
> > ===================================================================
>
> > Recipe file is:
>
> > ==================================================================
>
> >
>
> > #
>
> >
>
> > # Cookbook Name:: iptables
>
> >
>
> > # Recipe:: default
>
> >
>
> > #
>
> >
>
> > # Copyright 2008-2009, Opscode, Inc.
>
> >
>
> > #
>
> >
>
> > # Licensed under the Apache License, Version 2.0 (the "License");
>
> >
>
> > # you may not use this file except in compliance with the License.
>
> >
>
> > # You may obtain a copy of the License at
>
> >
>
> > #
>
> >
>
> > # http://www.apache.org/licenses/LICENSE-2.0
>
> >
>
> > #
>
> >
>
> > # Unless required by applicable law or agreed to in writing, software
>
> >
>
> > # distributed under the License is distributed on an "AS IS" BASIS,
>
> >
>
> > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
>
> > implied.
>
> >
>
> > # See the License for the specific language governing permissions and
>
> >
>
> > # limitations under the License.
>
> >
>
> > #
>
> >
>
> > package "iptables"
>
> >
>
> > execute "rebuild-iptables" do
>
> >
>
> > command "/usr/sbin/rebuild-iptables"
>
> >
>
> > action :nothing
>
> >
>
> > end
>
> >
>
> > directory "/etc/iptables.d" do
>
> >
>
> > action :create
>
> >
>
> > end
>
> >
>
> > cookbook_file "/usr/sbin/rebuild-iptables" do
>
> >
>
> > source "rebuild-iptables"
>
> >
>
> > mode 0755
>
> >
>
> > end
>
> >
>
> > iptables_rule "all_established"
>
> >
>
> > iptables_rule "all_icmp"
>
> >
>
> > ==============================================
>
> > Can you please help ?
>
> > Cheers,
>
> > KD
>
> >
>
> > On Mon, Oct 24, 2011 at 1:54 PM, Kandarp Desai
>
> > <
>
>
> > wrote:
>
> >>
>
> >> 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
>
> >>> >> >
>
> >>> >
>
> >>> >
>
> >>
>
> >
>
>
>
>
>
>
>
> --
>
> Opscode, Inc
>
> Joshua Timberman, Technical Program Manager
>
> IRC, Skype, Twitter, Github: jtimberman
>
>
- [chef] Problem While Installing Linux Package with Chef, Kandarp Desai, 10/24/2011
- [chef] Re: Problem While Installing Linux Package with Chef, AJ Christensen, 10/24/2011
- [chef] Re: Re: Problem While Installing Linux Package with Chef, Kandarp Desai, 10/24/2011
- [chef] Re: Re: Re: Problem While Installing Linux Package with Chef, AJ Christensen, 10/24/2011
- [chef] Re: Re: Re: Re: Problem While Installing Linux Package with Chef, Kandarp Desai, 10/24/2011
- [chef] Re: Re: Re: Re: Re: Re: Problem While Installing Linux Package with Chef, Daniel DeLeo, 10/24/2011
- [chef] Re: Problem While Installing Linux Package with Chef, Adam Jacob, 10/25/2011
- [chef] Re: Re: Problem While Installing Linux Package with Chef, Kandarp Desai, 10/25/2011
- [chef] Re: Re: Problem While Installing Linux Package with Chef, Kandarp Desai, 10/25/2011
[chef] Re: Re: Re: Problem While Installing Linux Package with Chef, Michael Glenney, 10/25/2011
Archive powered by MHonArc 2.6.16.