- From: Landon <
>
- To:
- Subject: [chef] Iterating over attributes in a template
- Date: Wed, 11 Aug 2010 14:55:23 -0700
This might be a fundamental misunderstand on my part, but I can't
figure out how to iterate nested attributes in a template.
Here's what I have so far:
Recipe
template "/tmp/config.xml do
source "config.xml.erb"
variables :interface => node[:config][:interface]
end
Attributes file:
default[:config] = {
:interface => {
:total_cards => "75",
:relevant_results => "6"
}
}
Template:
<% @interface.each do |x| %>
<% end %>
The error I get:
Chef::Mixin::Template::TemplateError (You tried to set a nested key,
where the parent is not a hash-like object
Thoughts? I have been beating my head on this.
Thanks,
Landon
- [chef] Iterating over attributes in a template, Landon, 08/11/2010
Archive powered by MHonArc 2.6.16.