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.
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
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.
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: gist:2832357 · GitHub
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
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:
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.
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: gist:2832357 · GitHub
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
to your suggestion:
"override_attributes": {
"yum": {
"exclude": [ "kernel*" ],
"installonlypkgs": {
}
}
}
Made it work.
Thanks again,
Cooper
On Tue, May 29, 2012 at 10:47 PM, Matthew Moretti werebus@gmail.com wrote:
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:
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.
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