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

66 lines
2.0 KiB
Plaintext

#!/usr/bin/env bash
# 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.
# If you want to override these variables, create a file called 'localrc'
# and place it in the same directory as this file.
# rc file(s) location
RC_DIR=$(cd $(dirname "${BASH_SOURCE:-$0}") && pwd)
# allow local overrides of env variables
if [[ -f $RC_DIR/localrc ]]; then
source $RC_DIR/localrc
fi
# IP address/hostname to use for the services
SERVICE_HOST=<%= @service_host %>
# Directory where all the service files will live
SERVICE_DIR=<%= @service_dir %>
USE_SCREEN="True"
# ZK Hosts (comma delimited)
<%- 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(",") %>
# MidoNet API port and URI
API_PORT=<%= @api_port %>
API_URI=http://$SERVICE_HOST:$API_PORT/midonet-api
MIDO_KEYSTONE_USER=<%= @mido_keystone_user %>
MIDO_KEYSTONE_PASSWORD=<%= @mido_keystone_password %>
MIDO_PROJECT_ID=<%= @mido_project_id %>
# MidoNet Client
# --------------
# Auth variables. They are exported so that you could source this file and
# run midonet-cli using these credentials
export MIDO_API_URL=$API_URI
export MIDO_USER=${MIDO_KEYSTONE_USER:-admin}
export MIDO_PROJECT_ID=${MIDO_PROJECT_ID:-admin}
export MIDO_PASSWORD=${MIDO_KEYSTONE_PASSWORD:-midonet}