Reputation: 103
This is my attribute file.I want to get the wka members details through the loop.
default["clustering"] = {
"enabled" => true,
"membership_scheme" => 'wka',
"domain" => 'wr.as.domain',
"local_member_host" => '10.100.4.777',
"local_member_port" => '4000',
"sub_domain" => 'mgt',
"wka" => {
"members" => [
{
"hostname" => '10.100.4.555',
"port" => 4000
},
{
"hostname" => '10.100.4.556',
"port" => 4000
}
]
}
}
This is my template file
<members>
<%= node["clustering"]["wka"]["members"].each do |member| -%>
<member>
<hostName><%= member['hostname'] %></hostName>
<port><%= member['port'] %></port>
</member>
<% end %>
</members>
Can someone suggest me the right solution for this error?
Upvotes: 2
Views: 48
Reputation: 54249
For non-printing bits in the template, like loops or conditionals, you use <%
or <%-
(the latter trims extra whitespace and is usually what you want), not <%=
.
Upvotes: 2