Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
215d473
Removed monasca-api role.
jgrassler Jan 4, 2017
aee8cc8
Added up-to-date WSGI plumbing.
jgrassler Jan 4, 2017
0a93eaf
Addressed Hound comments.
jgrassler Jan 4, 2017
8259246
Fix barbican schema template
samirjorina Jan 11, 2017
5cc52d8
Install monasca-ui horizon plugin
samirjorina Jan 10, 2017
64aa8db
Initial commit for the log-agent
Jan 17, 2017
f55cf0c
Use dedicated users for monasca-log-agent (#11)
kornicameister Feb 7, 2017
0d1e839
Configure monasca-ui plugin (#6)
samirjorina Feb 20, 2017
e6f98fd
Add monitoring dashboards to Grafana
samirjorina Feb 27, 2017
aa7e75a
Provide Ansible integration
samirjorina Feb 28, 2017
627c85e
Add missing end keyword (#16)
samirjorina Mar 3, 2017
212f93f
Fix json indentation (#17)
matrixik Mar 3, 2017
f3fc36e
Update monasca-agent cookbook and barclamp (#2)
matrixik Mar 9, 2017
ab4155d
Disable systemd service file creation (#19)
Mar 14, 2017
fd69cc7
Fix invalid files location
samirjorina Mar 15, 2017
94318dc
Get proper log-api url for monasca-log-agent (#18)
matrixik Mar 15, 2017
8df9f37
Finish integration of Ansible installer (#15)
samirjorina Mar 16, 2017
f261fe7
Use sudo for running monasca-reconfigure (#21)
matrixik Mar 16, 2017
4c74e9c
Remove default grafana config file (#22)
samirjorina Mar 21, 2017
eff582f
Fix monasca-log-agent rpm name (#24)
matrixik Mar 22, 2017
6db37e5
Fix suse (#23)
samirjorina Mar 23, 2017
fd75ed6
Remove unused group (#27)
artur-ba Mar 24, 2017
42226be
Disable deprecation_warnings for Ansible (#34)
matrixik Mar 28, 2017
ff3039e
Agent log dir (#33)
samirjorina Mar 29, 2017
f6d3d86
Configure agent service name for monasca setup (#32)
samirjorina Mar 31, 2017
1b22220
Address review comments (#35)
samirjorina Apr 3, 2017
4ce3587
Fix agent config (#31)
samirjorina Apr 3, 2017
2a7c7bb
Remove offline resources (#36)
artur-ba Apr 3, 2017
3aad3a2
Run monasca-reconfigure only when the file changes (#38)
matrixik Apr 6, 2017
01f59d9
Replace all cmm occurrences with monasca (#37)
matrixik Apr 11, 2017
b6190bd
Use node_search_with_cache method (#39)
artur-ba Apr 11, 2017
90525b8
Log agent config (#40)
samirjorina Apr 12, 2017
e30910e
Start and enable agents after installation
samirjorina Apr 12, 2017
e86104e
Add ha to monasca barclamp
samirjorina Feb 24, 2017
86db54b
Update HA for monasca barclamp with all services
matrixik Apr 3, 2017
c25f22e
Uncomment code for cluster validation
matrixik Apr 3, 2017
a3ab6a1
Address Hound comments
matrixik Apr 3, 2017
b5152f5
Add influxdb relay config
matrixik Apr 4, 2017
e924c71
Address hound comments
matrixik Apr 4, 2017
5f1ba3a
Add frontend for InfluxDB
matrixik Apr 6, 2017
730fc30
Fix getting port for api and log-api servers
matrixik Apr 6, 2017
df30921
Fix loadbalancer for influx parts
matrixik Apr 6, 2017
a4debf5
Remove including HA from role_monasca_master
matrixik Apr 6, 2017
df0b813
Add more config options for HAProxy
matrixik Apr 7, 2017
d5bf677
Remove unnecessary configuration
matrixik Apr 7, 2017
5410607
Update hosts-cluster with proper virtual IP
matrixik Apr 10, 2017
f54d467
Use only admin and public networks
matrixik Apr 11, 2017
67dae9e
Use different ports for services running behind HAProxy
matrixik Apr 12, 2017
6a9528e
Use proper influxdb ports in cluster
matrixik Apr 13, 2017
daed0a3
Remove haproxy and keepalived hosts from hosts-cluster
matrixik Apr 13, 2017
0d68a01
Add more helpers
matrixik Apr 14, 2017
1c56481
Fix setting proper ports in cluster
matrixik Apr 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,751 changes: 4,751 additions & 0 deletions chef/cookbooks/horizon/files/default/grafana-monasca.json

Large diffs are not rendered by default.

847 changes: 847 additions & 0 deletions chef/cookbooks/horizon/files/default/grafana-openstack.json

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions chef/cookbooks/horizon/libraries/helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Copyright 2016 SUSE Linux GmbH
#
# 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.

module MonascaUiHelper
def self.monasca_public_host(node)
ha_enabled = node[:monasca][:ha][:enabled]
ssl_enabled = node[:monasca][:api][:ssl]
CrowbarHelper.get_host_for_public_url(node, ssl_enabled, ha_enabled)
end

def self.api_public_url(node)
host = monasca_public_host(node)
# SSL is not supported at this moment
# protocol = node[:monasca][:api][:ssl] ? "https" : "http"
protocol = "http"
port = node[:monasca][:api][:bind_port]
"#{protocol}://#{host}:#{port}/v2.0"
end
end
69 changes: 69 additions & 0 deletions chef/cookbooks/horizon/recipes/monasca_ui.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Copyright 2016 SUSE Linux GmbH
#
# 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.

monasca_server = node_search_with_cache("roles:monasca-server").first
if monasca_server.nil?
Chef::Log.warn("No monasca-server found.")
return
end

template "/srv/www/openstack-dashboard/openstack_dashboard/"\
"local/local_settings.d/_80_monasca_ui_settings.py" do
source "_80_monasca_ui_settings.py.erb"
variables(
kibana_enabled: true,
kibana_host: MonascaUiHelper.monasca_public_host(monasca_server)
)
owner "root"
group "root"
mode "0644"
notifies :reload, resources(service: "apache2")
end

package "grafana-apache" do
action :install
notifies :reload, resources(service: "apache2")
end

file "/etc/apache2/vhosts.d/grafana.conf" do
action :delete
notifies :reload, resources(service: "apache2")
end

template "/srv/www/grafana/config.js" do
source "grafana-config.js"
variables(
api_url: MonascaUiHelper.api_public_url(monasca_server)
)
owner "root"
group "www"
mode "0644"
notifies :reload, resources(service: "apache2")
end

cookbook_file "/srv/www/grafana/app/dashboards/openstack.json" do
source "grafana-openstack.json"
owner "root"
group "root"
mode "0644"
notifies :reload, resources(service: "apache2")
end

cookbook_file "/srv/www/grafana/app/dashboards/monasca.json" do
source "grafana-monasca.json"
owner "root"
group "root"
mode "0644"
notifies :reload, resources(service: "apache2")
end
27 changes: 24 additions & 3 deletions chef/cookbooks/horizon/recipes/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
include_recipe "apache2::mod_wsgi"
include_recipe "apache2::mod_rewrite"

keystone_settings = KeystoneHelper.keystone_settings(node, @cookbook_name)

if %w(suse).include? node[:platform_family]
dashboard_path = "/srv/www/openstack-dashboard"
else
Expand Down Expand Up @@ -154,6 +156,26 @@
end
end

monasca_ui_pkgname =
case node[:platform_family]
when "suse"
"openstack-horizon-plugin-monasca-ui"
when "rhel"
"openstack-monasca-ui"
end

unless monasca_ui_pkgname.nil?
monasca_servers = node_search_with_cache("roles:monasca-server")
unless monasca_servers.empty?
include_recipe "#{@cookbook_name}::monasca_ui"
package monasca_ui_pkgname do
action :install
notifies :reload, resources(service: "apache2")
end
grafana_available = true
end
end

if node[:platform_family] == "suse"
# Get rid of unwanted vhost config files:
["#{node[:apache][:dir]}/vhosts.d/default-redirect.conf",
Expand Down Expand Up @@ -262,8 +284,6 @@
"default-character-set" => "'utf8'"
}

keystone_settings = KeystoneHelper.keystone_settings(node, @cookbook_name)

glances = search(:node, "roles:glance-server") || []
if glances.length > 0
glance = glances[0]
Expand Down Expand Up @@ -490,7 +510,8 @@
use_ssl: node[:horizon][:apache][:ssl],
ssl_crt_file: node[:horizon][:apache][:ssl_crt_file],
ssl_key_file: node[:horizon][:apache][:ssl_key_file],
ssl_crt_chain_file: node[:horizon][:apache][:ssl_crt_chain_file]
ssl_crt_chain_file: node[:horizon][:apache][:ssl_crt_chain_file],
grafana_available: defined?(grafana_available) ? grafana_available : false
)
if ::File.symlink?("#{node[:apache][:dir]}/sites-enabled/openstack-dashboard.conf") || node[:platform_family] == "suse"
notifies :reload, resources(service: "apache2")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Copyright 2016 SUSE Linux GmbH
#
# 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.

from django.conf import settings
from django.utils.translation import ugettext_lazy as _

# Services being monitored
MONITORING_SERVICES = getattr(
settings,
'MONITORING_SERVICES',
[
{'name': _('OpenStack Services'),
'groupBy': 'service'},
{'name': _('Servers'),
'groupBy': 'hostname'},
{'name': _('Log Paths'),
'groupBy': 'path'}
]
)

MONITORING_SERVICE_TYPE = getattr(
settings, 'MONITORING_SERVICE_TYPE', 'monitoring'
)


# Grafana button titles/file names (global across all projects):
GRAFANA_LINKS = [
{'title': 'Dashboard', 'fileName': 'openstack.json'},
{'title': 'Monasca Health', 'fileName': 'monasca.json'}
]

DEFAULT_LINKS = GRAFANA_LINKS
DASHBOARDS = getattr(settings, 'GRAFANA_LINKS', GRAFANA_LINKS)

#
# Per project grafana button titles/file names. If in this form,
# '*' will be applied to all projects not explicitly listed.
#
# Note the above form (flat) is supported for backward compatibility.
#
#GRAFANA_LINKS = [
# {'admin': [
# {'title': 'Dashboard', 'fileName': 'openstack.json'},
# {'title': 'RabbitMQ', 'fileName': 'rabbit.json'},
# {'title': 'Project Utilization', 'fileName': 'libvirt.json'}]},
# {'*': [
# {'title': 'OpenStack Dashboard', 'fileName': 'project.json'},
# {'title': 'Add New Dashboard', 'fileName': 'empty.json'}]}
#]

ENABLE_KIBANA_BUTTON = getattr(settings, 'ENABLE_KIBANA_BUTTON', <%= @kibana_enabled ? "True" : "False" %>)
# TODO: this needs to be fixed for clustered deployment
KIBANA_HOST = getattr(settings, 'KIBANA_HOST', 'http://<%= @kibana_host %>:5601/')

OPENSTACK_SSL_NO_VERIFY = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False)
OPENSTACK_SSL_CACERT = getattr(settings, 'OPENSTACK_SSL_CACERT', None)
OPENSTACK_ENDPOINT_TYPE="publicURL"
48 changes: 48 additions & 0 deletions chef/cookbooks/horizon/templates/default/grafana-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
define(['settings'],
function (Settings) {
"use strict";

return new Settings({

datasources: {
mon: {
type: 'mon',
url: "<%= @api_url %>",
default: true,
grafanaDB: true
}
},

/* Global configuration options
* ========================================================
*/

// specify the limit for dashboard search results
search: {
max_results: 20
},

// default start dashboard
default_route: '/file/default.json',

// set to false to disable unsaved changes warning
unsaved_changes_warning: true,

// set the default timespan for the playlist feature
// Example: "1m", "1h"
playlist_timespan: "1m",

// If you want to specify password before saving, please specify it bellow
// The purpose of this password is not security, but to stop some users from accidentally changing dashboards
admin: {
password: ''
},

// Add your own custom pannels
plugins: {
panels: []
}

});
});

Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@
DocumentRoot <%= @horizon_dir %>
Alias /media <%= @horizon_dir %>/media
Alias /static <%= @horizon_dir %>/static
<% if @grafana_available %>
Alias /grafana /srv/www/grafana
<% end %>

Timeout 120

Expand All @@ -54,6 +57,11 @@
ExpiresActive on
ExpiresDefault "access plus 1 month"
</Location>
<% if @grafana_available %>
<Location /grafana>
Require all granted
</Location>
<% end %>

<Directory />
Options None
Expand Down
2 changes: 1 addition & 1 deletion chef/cookbooks/monasca/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DESCRIPTION

Chef Cookbook to install and configure Monasca. This cookbook contains 2 roles:

* monasca-agent: deploys monasca-agent on arbitrary nodes
* monasca-metric-agent: deploys monasca metric agent on arbitrary nodes
* monasca-server: deploys Monasca's backend services on dedicated Monasca nodes

REQUIREMENTS
Expand Down
48 changes: 45 additions & 3 deletions chef/cookbooks/monasca/attributes/default.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#
# Copyright 2016 SUSE Linux GmbH
# 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.
Expand All @@ -13,14 +14,55 @@
# See the License for the specific language governing permissions and
# limitation.

monasca_debug = false
monasca_ha_enabled = false

monasca_metric_agent_service_name = "monasca-agent"
monasca_log_agent_service_name = "monasca-log-agent"

default[:monasca][:platform] = {
packages: [],
services: [
monasca_metric_agent_service_name,
monasca_log_agent_service_name
]
}

default[:monasca][:db][:database] = "monasca"
default[:monasca][:db][:user] = "monasca"
default[:monasca][:db][:password] = nil # must be set by wrapper

override[:monasca][:group] = "monasca"
override[:monasca][:user] = "monasca"

default[:monasca][:debug] = false
default[:monasca][:ha_enabled] = false
default[:monasca][:debug] = monasca_debug

# metric-agent default service settings
default[:monasca][:metric_agent][:service_name] = monasca_metric_agent_service_name
default[:monasca][:metric_agent][:user] = "monasca-agent"
default[:monasca][:metric_agent][:group] = "monasca"
default[:monasca][:metric_agent][:debug] = monasca_debug
default[:monasca][:metric_agent][:agent_service_name] = "openstack-monasca-agent"

# log-agent default service settings
default[:monasca][:log_agent][:service_name] = monasca_log_agent_service_name
default[:monasca][:log_agent][:user] = "monasca-log-agent"
default[:monasca][:log_agent][:group] = "logstash"
default[:monasca][:log_agent][:debug] = monasca_debug

# default[:monasca][:api][:bind_host] = "*"
# default[:monasca][:log_api][:bind_host] = "*"
# default[:monasca][:kibana][:bind_host] = "*"
# default[:monasca][:mariadb][:bind_host] = "-"
# default[:monasca][:influxdb][:bind_host] = "-"

default[:monasca][:api][:bind_host] = "*"
default[:monasca][:ha][:enabled] = monasca_ha_enabled
# Ports to bind to when haproxy is used for the real ports
# Public network
default[:monasca][:ha][:ports][:api] = 18070
default[:monasca][:ha][:ports][:log_api] = 15607
default[:monasca][:ha][:ports][:kibana] = 15601
# Internal network
default[:monasca][:ha][:ports][:mariadb] = 13306
default[:monasca][:ha][:ports][:influxdb] = 18086
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remember in the future to change this port to InfluxDB Relay port

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added InfluxDB Relay port but need to learn how to use frontend and backend HAProxy configuration with barclamps. For now added FIXME comments in code.

default[:monasca][:ha][:ports][:influxdb_relay] = 9096
Loading