{ "nodes": [ <%- index = 1 -%> <%- @manager_ip.each do |ip| -%> <%- if index == @manager_ip.size -%> { "ip": "<%= ip %>", "id": "<%= ip %>", "tcpPort": 9876 } <%- else -%> { "ip": "<%= ip %>", "id": "<%= ip %>", "tcpPort": 9876 }, <%- end -%> <%- index = index + 1 -%> <%- end -%> ], "partitions": { <%- key = 1 -%> <%- @manager_ip.each do |ip| -%> <%- if key == @manager_ip.size -%> "p<%= key -%>":[ <%- index = 1 -%> <%- @manager_ip.each do |ip| -%> <%- if index == @manager_ip.size -%> { "ip": "<%= ip %>", "id": "<%= ip %>", "tcpPort": 9876 } <%- else -%> { "ip": "<%= ip %>", "id": "<%= ip %>", "tcpPort": 9876 }, <%- end -%> <%- index = index + 1 -%> <%- end -%> ] <%- key = key + 1 -%> <%- else -%> "p<%= key -%>":[ <%- index = 1 -%> <%- @manager_ip.each do |ip| -%> <%- if index == @manager_ip.size -%> { "ip": "<%= ip %>", "id": "<%= ip %>", "tcpPort": 9876 } <%- else -%> { "ip": "<%= ip %>", "id": "<%= ip %>", "tcpPort": 9876 }, <%- end -%> <%- index = index + 1 -%> <%- end -%> ], <%- key = key + 1 -%> <%- end -%> <%- end -%> } }