Just looking at it now, there seems to be some inconsistency in that
cookbook. The metadata file and the example in the comments of
attributes/default.rb suggest that the attribute should be a string made up
of space-separated arguments. However, both templates call #join on it
(which strings don’t have)
It would seem that the attribute should be an array. If so, it you would
specify it with something like:
“exclude”: [ “kernel*” ],
I think. FWIW, I mostly stick with Ubuntu, so my familiarity with yum is
On Tue, May 29, 2012 at 11:22 PM, Cooper Simmons
I thought that’s what I was doing with that json in the role:
That entry is what causes the fatal error when I run chef-client on the
Is my json is set up wrong for this overriding attribute?
On Tue, May 29, 2012 at 8:58 PM, Wolfe, Eric G firstname.lastname@example.org:
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 email@example.com wrote:
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*”
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:
But that gave me a fatal error:
FATAL: Chef::Mixin::Template::TemplateError: undefined method `join’ for
Can anyone tell me how to add excludes to the yum.conf file with the yum