Adding qpid support to ceilometer
Moving all qpid parameters under default["openstack"]["metering"] ["mq"]["qpid"] so that other qpid options can be added under it. Rabbit parameters will be brought under "mq" eventually. MQ is selected through default["openstack"]["metering"]["mq"]["service_type"]. Default is "rabbitmq". Implements: blueprint qpid-activemq-support Change-Id: I4dd153a631063ee7c518e2d49fe01aa39a6f261d
This commit is contained in:
parent
dc89aea2de
commit
510d2ee279
|
@ -2,6 +2,11 @@ openstack-metering Cookbook CHANGELOG
|
||||||
==============================
|
==============================
|
||||||
This file is used to list changes made in each version of the openstack-metering cookbook.
|
This file is used to list changes made in each version of the openstack-metering cookbook.
|
||||||
|
|
||||||
|
v7.1.0
|
||||||
|
------
|
||||||
|
### Blueprint
|
||||||
|
- Added qpid support to ceilometer. default is rabbitmq
|
||||||
|
|
||||||
v7.0.5
|
v7.0.5
|
||||||
------
|
------
|
||||||
### Bug
|
### Bug
|
||||||
|
|
|
@ -64,10 +64,12 @@ License and Author
|
||||||
| **Author** | Matt Ray (<matt@opscode.com>) |
|
| **Author** | Matt Ray (<matt@opscode.com>) |
|
||||||
| **Author** | John Dewey (<jdewey@att.com>) |
|
| **Author** | John Dewey (<jdewey@att.com>) |
|
||||||
| **Author** | Justin Shepherd (<jshepher@rackspace.com>) |
|
| **Author** | Justin Shepherd (<jshepher@rackspace.com>) |
|
||||||
|
| **Author** | Salman Baset (<sabaset@us.ibm.com>) |
|
||||||
| | |
|
| | |
|
||||||
| **Copyright** | Copyright (c) 2013, Opscode, Inc. |
|
| **Copyright** | Copyright (c) 2013, Opscode, Inc. |
|
||||||
| **Copyright** | Copyright (c) 2013, AT&T Services, Inc. |
|
| **Copyright** | Copyright (c) 2013, AT&T Services, Inc. |
|
||||||
| **Copyright** | Copyright (c) 2013, Rackspace US, Inc. |
|
| **Copyright** | Copyright (c) 2013, Rackspace US, Inc. |
|
||||||
|
| **Copyright** | Copyright (c) 2013, IBM Corp. |
|
||||||
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
|
|
@ -32,6 +32,26 @@ default["openstack"]["metering"]["rabbit"]["port"] = 5672
|
||||||
default["openstack"]["metering"]["rabbit"]["host"] = "127.0.0.1"
|
default["openstack"]["metering"]["rabbit"]["host"] = "127.0.0.1"
|
||||||
default["openstack"]["metering"]["rabbit"]["ha"] = false
|
default["openstack"]["metering"]["rabbit"]["ha"] = false
|
||||||
|
|
||||||
|
# MQ options
|
||||||
|
default["openstack"]["metering"]["mq"]["service_type"] = node["openstack"]["mq"]["service_type"]
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["host"] = "127.0.0.1"
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["port"] = "5672"
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["qpid_hosts"] = ['127.0.0.1:5672']
|
||||||
|
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["username"] = ""
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["password"] = ""
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["sasl_mechanisms"] = ""
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["reconnect"] = true
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["reconnect_timeout"] = 0
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["reconnect_limit"] = 0
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["reconnect_interval_min"] = 0
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["reconnect_interval_max"] = 0
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["reconnect_interval"] = 0
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["heartbeat"] = 60
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["protocol"] = "tcp"
|
||||||
|
default["openstack"]["metering"]["mq"]["qpid"]["tcp_nodelay"] = true
|
||||||
|
|
||||||
|
|
||||||
default["openstack"]["metering"]["conf_dir"] = "/etc/ceilometer"
|
default["openstack"]["metering"]["conf_dir"] = "/etc/ceilometer"
|
||||||
default["openstack"]["metering"]["conf"] = ::File.join(node["openstack"]["metering"]["conf_dir"], "ceilometer.conf")
|
default["openstack"]["metering"]["conf"] = ::File.join(node["openstack"]["metering"]["conf_dir"], "ceilometer.conf")
|
||||||
default["openstack"]["metering"]["db"]["username"] = "ceilometer"
|
default["openstack"]["metering"]["db"]["username"] = "ceilometer"
|
||||||
|
|
|
@ -4,7 +4,7 @@ maintainer_email "cookbooks@lists.tfoundry.com"
|
||||||
license "Apache 2.0"
|
license "Apache 2.0"
|
||||||
description "The OpenStack Metering service Ceilometer."
|
description "The OpenStack Metering service Ceilometer."
|
||||||
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
|
||||||
version "7.0.5"
|
version "7.1.0"
|
||||||
|
|
||||||
recipe "openstack-metering::agent-central", "Installs agent central service."
|
recipe "openstack-metering::agent-central", "Installs agent central service."
|
||||||
recipe "openstack-metering::agent-compute", "Installs agent compute service."
|
recipe "openstack-metering::agent-compute", "Installs agent compute service."
|
||||||
|
|
|
@ -32,7 +32,9 @@ platform["common_packages"].each do |pkg|
|
||||||
package pkg
|
package pkg
|
||||||
end
|
end
|
||||||
|
|
||||||
rabbit_pass = user_password node["openstack"]["metering"]["rabbit"]["username"]
|
if node["openstack"]["metering"]["mq"]["service_type"] == "rabbitmq"
|
||||||
|
rabbit_pass = user_password node["openstack"]["metering"]["rabbit"]["username"]
|
||||||
|
end
|
||||||
|
|
||||||
db_info = db "metering"
|
db_info = db "metering"
|
||||||
db_user = node["openstack"]["metering"]["db"]["username"]
|
db_user = node["openstack"]["metering"]["db"]["username"]
|
||||||
|
|
|
@ -91,6 +91,88 @@ describe "openstack-metering::common" do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "qpid" do
|
||||||
|
before do
|
||||||
|
@file = @chef_run.template "/etc/ceilometer/ceilometer.conf"
|
||||||
|
@chef_run.node.set['openstack']['metering']['mq']['service_type'] = "qpid"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_hostname" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_hostname=127.0.0.1"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_port" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_port=5672"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_username" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_username="
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_password" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_password="
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_sasl_mechanisms" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_sasl_mechanisms="
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_reconnect" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_reconnect=true"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_reconnect_timeout" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_reconnect_timeout=0"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_reconnect_limit" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_reconnect_limit=0"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_reconnect_interval_min" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_reconnect_interval_min=0"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_reconnect_interval_max" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_reconnect_interval_max=0"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_reconnect_interval_max" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_reconnect_interval_max=0"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_reconnect_interval" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_reconnect_interval=0"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_heartbeat" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_heartbeat=60"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_protocol" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_protocol=tcp"
|
||||||
|
end
|
||||||
|
|
||||||
|
it "has qpid_tcp_nodelay" do
|
||||||
|
expect(@chef_run).to create_file_with_content @file.name,
|
||||||
|
"qpid_tcp_nodelay=true"
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "/etc/ceilometer/policy.json" do
|
describe "/etc/ceilometer/policy.json" do
|
||||||
before do
|
before do
|
||||||
@dir = @chef_run.cookbook_file "/etc/ceilometer/policy.json"
|
@dir = @chef_run.cookbook_file "/etc/ceilometer/policy.json"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
require "chefspec"
|
require "chefspec"
|
||||||
|
require "chef/application"
|
||||||
|
|
||||||
::LOG_LEVEL = :fatal
|
::LOG_LEVEL = :fatal
|
||||||
::OPENSUSE_OPTS = {
|
::OPENSUSE_OPTS = {
|
||||||
|
@ -28,6 +29,7 @@ def metering_stubs
|
||||||
::Chef::Recipe.any_instance.stub(:secret).
|
::Chef::Recipe.any_instance.stub(:secret).
|
||||||
with("secrets", "openstack_identity_bootstrap_token").
|
with("secrets", "openstack_identity_bootstrap_token").
|
||||||
and_return "bootstrap-token"
|
and_return "bootstrap-token"
|
||||||
|
::Chef::Application.stub(:fatal!)
|
||||||
end
|
end
|
||||||
|
|
||||||
def expect_runs_common_recipe
|
def expect_runs_common_recipe
|
||||||
|
|
|
@ -8,14 +8,43 @@ os_password = <%= @service_pass %>
|
||||||
os_username = <%= @service_user %>
|
os_username = <%= @service_user %>
|
||||||
policy_file = /etc/ceilometer/policy.json
|
policy_file = /etc/ceilometer/policy.json
|
||||||
database_connection = <%= @database_connection %>
|
database_connection = <%= @database_connection %>
|
||||||
|
verbose = True
|
||||||
|
|
||||||
|
notification_topics = notifications,glance_notifications
|
||||||
|
<% if node["openstack"]["metering"]["mq"]["service_type"] == "rabbitmq" %>
|
||||||
|
##### RABBITMQ #####
|
||||||
rabbit_userid = <%= node["openstack"]["metering"]["rabbit"]["username"] %>
|
rabbit_userid = <%= node["openstack"]["metering"]["rabbit"]["username"] %>
|
||||||
rabbit_password = <%= @rabbit_pass %>
|
rabbit_password = <%= @rabbit_pass %>
|
||||||
rabbit_port = <%= node["openstack"]["metering"]["rabbit"]["port"] %>
|
rabbit_port = <%= node["openstack"]["metering"]["rabbit"]["port"] %>
|
||||||
rabbit_host = <%= node["openstack"]["metering"]["rabbit"]["host"] %>
|
rabbit_host = <%= node["openstack"]["metering"]["rabbit"]["host"] %>
|
||||||
rabbit_virtual_host = <%= node["openstack"]["metering"]["rabbit"]["vhost"] %>
|
rabbit_virtual_host = <%= node["openstack"]["metering"]["rabbit"]["vhost"] %>
|
||||||
verbose = True
|
|
||||||
notification_topics = notifications,glance_notifications
|
|
||||||
rpc_backend = ceilometer.openstack.common.rpc.impl_kombu
|
rpc_backend = ceilometer.openstack.common.rpc.impl_kombu
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
|
<% if node["openstack"]["metering"]["mq"]["service_type"] == "qpid" %>
|
||||||
|
##### QPID #####
|
||||||
|
rpc_backend=nova.openstack.common.rpc.impl_qpid
|
||||||
|
qpid_hostname=<%= node["openstack"]["metering"]["mq"]["qpid"]["host"] %>
|
||||||
|
qpid_port=<%= node["openstack"]["metering"]["mq"]["qpid"]["port"] %>
|
||||||
|
|
||||||
|
qpid_password=<%= node["openstack"]["metering"]["mq"]["qpid"]["password"] %>
|
||||||
|
qpid_username=<%= node["openstack"]["metering"]["mq"]["qpid"]["username"] %>
|
||||||
|
qpid_sasl_mechanisms=<%= node["openstack"]["metering"]["mq"]["qpid"]["sasl_mechanisms"] %>
|
||||||
|
qpid_reconnect=<%= node["openstack"]["metering"]["mq"]["qpid"]["reconnect"] %>
|
||||||
|
qpid_reconnect_timeout=<%= node["openstack"]["metering"]["mq"]["qpid"]["reconnect_timeout"] %>
|
||||||
|
qpid_reconnect_limit=<%= node["openstack"]["metering"]["mq"]["qpid"]["reconnect_limit"] %>
|
||||||
|
qpid_reconnect_interval_min=<%= node["openstack"]["metering"]["mq"]["qpid"]["reconnect_interval_min"] %>
|
||||||
|
qpid_reconnect_interval_max=<%= node["openstack"]["metering"]["mq"]["qpid"]["reconnect_interval_max"] %>
|
||||||
|
qpid_reconnect_interval=<%= node["openstack"]["metering"]["mq"]["qpid"]["reconnect_interval"] %>
|
||||||
|
qpid_heartbeat=<%= node["openstack"]["metering"]["mq"]["qpid"]["heartbeat"] %>
|
||||||
|
# qpid protocol. default 'tcp'. set to 'ssl' to enable SSL
|
||||||
|
qpid_protocol=<%= node["openstack"]["metering"]["mq"]["qpid"]["protocol"] %>
|
||||||
|
qpid_tcp_nodelay=<%= node["openstack"]["metering"]["mq"]["qpid"]["tcp_nodelay"] %>
|
||||||
|
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
<% if node["openstack"]["metering"]["syslog"]["use"] %>
|
<% if node["openstack"]["metering"]["syslog"]["use"] %>
|
||||||
log_config = /etc/openstack/logging.conf
|
log_config = /etc/openstack/logging.conf
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Reference in New Issue