66 lines
1.8 KiB
Plaintext
66 lines
1.8 KiB
Plaintext
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
which mn-conf > /dev/null || {
|
|
echo "'mn-conf' cannot be found in \$PATH" >&2
|
|
exit 1
|
|
}
|
|
|
|
## Access to the NSDB
|
|
cat << EOF | mn-conf set -t default
|
|
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(",") %>"
|
|
}
|
|
|
|
cassandra {
|
|
<%- cass_hosts = Array.new -%>
|
|
<%- if @cassandra_servers.class == String -%>
|
|
<%- cass_hosts.push(@cassandra_servers) -%>
|
|
<%- else -%>
|
|
<%- cass_hosts = @cassandra_servers -%>
|
|
<%- end -%>
|
|
servers = "<%= cass_hosts.join(",") %>"
|
|
}
|
|
EOF
|
|
echo "cassandra.replication_factor : <%= @cassandra_rep_factor %>" | mn-conf set -t default
|
|
|
|
|
|
## Configure Keystone access
|
|
cat << EOF | mn-conf set -t default
|
|
cluster.auth {
|
|
provider_class = "org.midonet.cluster.auth.keystone.KeystoneService"
|
|
admin_role = "admin"
|
|
keystone.tenant_name = "<%= @keystone_tenant_name %>"
|
|
keystone.admin_token = "<%= @keystone_admin_token %>"
|
|
keystone.host = "<%= @keystone_host %>"
|
|
keystone.port = <%= @keystone_port %>
|
|
keystone.protocol = "<%= @keystone_protocol %>"
|
|
keystone.domain_name = "<%= @keystone_domain_name %>"
|
|
keystone.domain_id = "<%= @keystone_domain_id %>"
|
|
keystone.user_name = "<%= @keystone_user_name %>"
|
|
keystone.user_password = "<%= @keystone_user_password %>"
|
|
keystone.version = <%= @keystone_keystone_version %>
|
|
}
|
|
cluster.rest_api {
|
|
http_host = <%= @cluster_host %>
|
|
http_port = <%= @cluster_port %>
|
|
}
|
|
cluster.state_proxy.server {
|
|
address = <%= @state_proxy_address %>
|
|
port = <%= @state_proxy_port %>
|
|
}
|
|
EOF
|
|
|
|
exit 0
|