[chef] Re: Re: How to set excludes in yum cookbook?


Chronological Thread 
  • From: Cooper Simmons < >
  • To:
  • Subject: [chef] Re: Re: How to set excludes in yum cookbook?
  • Date: Tue, 29 May 2012 22:22:14 -0500

I thought that's what I was doing with that json in the role:


  "override_attributes": {
    "yum": {
      "exclude": "kernel*",
      "installonlypkgs": {
      }
    }
  }


That entry is what causes the fatal error when I run chef-client on the node.
Is my json is set up wrong for this overriding attribute?

Thanks,
Cooper



On Tue, May 29, 2012 at 8:58 PM, Wolfe, Eric G < " target="_blank"> > wrote:
Pretty sure it is an array attribute. So you need to put something like ..yum.exclude = [ "kernel*" ] in your role.  It used to be a default of the recipe, if I am not mistaken.
sent from my phone, excuse any nonsensical autocorrect stuff.

Cooper Simmons < "> > wrote:



Hello.

I would like to exclude certain packages in my yum.conf file but I can't figure out how to do it with the Opscode yum cookbook.

I see this in attributes/default.rb:
# Example: override.yum.exclude = "kernel* compat-glibc*"
default[:yum][:exclude]

And this in templates/default/yum-rhel6.conf.erb:
<%- if node[:yum][:exclude] %>
exclude=<%= node[:yum][:exclude].join(" ") %>
<%- end %>

I tried putting this in the attributes:
default[:yum][:exclude] = "kernel*"

But that didn't do anything.
Not sure where to put the override.
I tried putting this in the role override_attributes:  https://gist.github.com/2832357
But that gave me a fatal error:
FATAL: Chef::Mixin::Template::TemplateError: undefined method `join' for "kernel*":String

Can anyone tell me how to add excludes to the yum.conf file with the yum cookbook?
Thanks,
Cooper





Archive powered by MHonArc 2.6.16.

§