Hello.
In a template hazelcast.xml.erb file I have the following code:
<% if @cluster -%>
<% node['hazelcast']['clusteredips'].each do |ip| %>
<member><%= "#{ip}"%></member>
<% end %>
<% else -%>
<member><%= node['hazelcast']['ip-local']%></member>
<% node['hazelcast']['clusteredips'].each do |ip| %>
<member><%= "#{ip}"%></member>
<% end %>
<% end %>
@cluster
comes from a boolean attribute and basically says that if that variable is true, then add a 192.168.x.x line for each value of the clusteredips
array variable.
But if I need to apply the recipe to a machine which is not clustered anymore, i need the recipe to remove the old IPs and to leave only on IP, the one of the machine.
Is that possible?
Or I have to remove the conf file and recreate it?
Is there a better solution?
Thank you,
Gabriel