Skip to content

Commit

Permalink
Use only admin and public networks
Browse files Browse the repository at this point in the history
  • Loading branch information
matrixik committed Apr 12, 2017
1 parent 0031da9 commit 93d18aa
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
12 changes: 9 additions & 3 deletions chef/cookbooks/monasca/libraries/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,15 @@ def get_host_for_monitoring_url(node)
).address
end

def get_vip_for_monitoring_cluster(node)
def get_vip_for_public_cluster(node)
CrowbarPacemakerHelper.cluster_vip(
node, "monitoring"
node, "public"
)
end

def get_vip_for_admin_cluster(node)
CrowbarPacemakerHelper.cluster_vip(
node, "admin"
)
end

Expand All @@ -87,7 +93,7 @@ def network_settings(node)
@cluster_monitoring_ip ||= nil

if node[:monasca][:ha][:enabled] && !@cluster_monitoring_ip
@cluster_monitoring_ip = get_vip_for_monitoring_cluster(node)
@cluster_monitoring_ip = get_vip_for_admin_cluster(node)
end

if node[:monasca][:ha][:enabled]
Expand Down
8 changes: 5 additions & 3 deletions chef/cookbooks/monasca/recipes/master.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright 2017 Fujitsu LIMITED
#
#
# 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
Expand Down Expand Up @@ -36,7 +36,8 @@
end

monasca_node = search(:node, "roles:monasca-server")[0]
monitoring_vip = MonascaHelper.get_vip_for_monitoring_cluster(monasca_node)
public_vip = MonascaHelper.get_vip_for_public_cluster(monasca_node)
admin_vip = MonascaHelper.get_vip_for_admin_cluster(monasca_node)

template "/opt/monasca-installer/monasca-hosts" do
source hosts_template
Expand All @@ -46,7 +47,8 @@
variables(
monasca_host: monasca_hosts[0],
monasca_hosts: monasca_hosts,
monitoring_vip: monitoring_vip,
public_vip: public_vip,
admin_vip: admin_vip,
ansible_ssh_user: "root",
keystone_host: keystone_settings["public_url_host"]
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ localhost ansible_connection=local
keystone-node ansible_ssh_host=<%= @keystone_host %> ansible_ssh_user=<%= @ansible_ssh_user %>

# Load balancer hosts
monasca-log-api-balancer-node ansible_ssh_host=<%= @monitoring_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>
monasca-api-balancer-node ansible_ssh_host=<%= @monitoring_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>
kibana-balancer-node ansible_ssh_host=<%= @monitoring_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>
monasca-log-api-balancer-node ansible_ssh_host=<%= @public_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>
monasca-api-balancer-node ansible_ssh_host=<%= @public_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>
kibana-balancer-node ansible_ssh_host=<%= @public_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>

# ElasticSearch nodes for cluster
<% @monasca_hosts.each_with_index do |host, index| %>
Expand Down Expand Up @@ -77,7 +77,7 @@ kibana-balancer-node ansible_ssh_host=<%= @monitoring_vip %> ansible
<% end %>

# Load balancer node
balancer-node ansible_ssh_host=<%= @monitoring_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>
balancer-node ansible_ssh_host=<%= @admin_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>

#Storm Nimbus nodes
<% @monasca_hosts.each_with_index do |host, index| %>
Expand Down Expand Up @@ -108,7 +108,7 @@ monasca-thresh-node ansible_ssh_host=<%= @monasca_host %> ansible_s
<% end %>

# Keepalived nodes
keepalived-virtual-node ansible_ssh_host=<%= @monitoring_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>
keepalived-virtual-node ansible_ssh_host=<%= @admin_vip %> ansible_ssh_user=<%= @ansible_ssh_user %>

<% @monasca_hosts.each_with_index do |host, index| %>
<%= "keepalived-node-#{index} ansible_ssh_host=#{host}" %> ansible_ssh_user=<%= @ansible_ssh_user %>
Expand Down

0 comments on commit 93d18aa

Please sign in to comment.