Alex Ruiz Estradera bb91c82360 Allow single list of Zookeeper and cassandra
Change-Id: I69ba8f17007eaad96a933fbd45c397cdc0c498eb
2016-11-08 09:58:08 +01:00

27 lines
1.8 KiB
Plaintext

# Copyright 2016 Midokura SARL │
# │
# Licensed under the Apache License, Version 2.0 (the "License"); │
# you may not use this file except in compliance with the License. │
# You may obtain a copy of the License at │
# │
# http://www.apache.org/licenses/LICENSE-2.0 │
# │
# Unless required by applicable law or agreed to in writing, software │
# distributed under the License is distributed on an "AS IS" BASIS, │
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. │
# See the License for the specific language governing permissions and │
# limitations under the License. │
[zookeeper]
<%- zkarr = Array.new -%>
<%- zk_hosts = Array.new -%>
<%- if @zookeeeper_hosts.class == Hash -%>
<%- zk_hosts.push(@zookeeper_hosts) -%>
<%- else -%>
<%- zk_hosts = @zookeeper_hosts -%>
<%- end -%>
<%- zk_hosts.each do |s| -%>
<%- zkarr.push("#{s['ip']}:#{s['port'] ||= 2181 }") -%>
<%- end -%>
zookeeper_hosts = <%= zkarr.join(",") %>