Add an Endpoint in ceilometer

Added an endpoint in the ceilometer configuration
to dispatch the data to qdr running locally.

Depends-On: Ib3090c01bfdcb60168dd1c6db23c520a103c051e
Change-Id: I7bbac48f2dfa9ec532f56a814af25117e11511ea
This commit is contained in:
Nagasai Vinaykumar Kapalavai 2018-10-19 22:42:09 +00:00
parent 5b176cb91b
commit fac7faa952
2 changed files with 68 additions and 13 deletions

View File

@ -70,21 +70,41 @@
# [*oslomsg_notify_use_ssl*]
# Enable ssl oslo messaging services
# Defaults to hiera('oslo_messaging_notify_use_ssl', '0')
#
# [*notifier_host_addr*]
# (optional) Ip address of ceilometer notifier (edge qdr Endpoint)
# Defaults to false
#
# [*notifier_host_port*]
# (optional) Ceilometer notifier port
# Defaults to undef
#
# [*event_pipeline_publishers*]
# (Optional) A list of event pipeline publishers
# Defaults to undef
#
# [*pipeline_publishers*]
# (Optional) A list of pipeline publishers
# Defaults to undef
class tripleo::profile::base::ceilometer (
$step = Integer(hiera('step')),
$oslomsg_rpc_proto = hiera('oslo_messaging_rpc_scheme', 'rabbit'),
$oslomsg_rpc_hosts = any2array(hiera('oslo_messaging_rpc_node_names', undef)),
$oslomsg_rpc_password = hiera('oslo_messaging_rpc_password'),
$oslomsg_rpc_port = hiera('oslo_messaging_rpc_port', '5672'),
$oslomsg_rpc_username = hiera('oslo_messaging_rpc_user_name', 'guest'),
$oslomsg_rpc_use_ssl = hiera('oslo_messaging_rpc_use_ssl', '0'),
$oslomsg_notify_proto = hiera('oslo_messaging_notify_scheme', 'rabbit'),
$oslomsg_notify_hosts = any2array(hiera('oslo_messaging_notify_node_names', undef)),
$oslomsg_notify_password = hiera('oslo_messaging_notify_password'),
$oslomsg_notify_port = hiera('oslo_messaging_notify_port', '5672'),
$oslomsg_notify_username = hiera('oslo_messaging_notify_user_name', 'guest'),
$oslomsg_notify_use_ssl = hiera('oslo_messaging_notify_use_ssl', '0'),
$step = Integer(hiera('step')),
$oslomsg_rpc_proto = hiera('oslo_messaging_rpc_scheme', 'rabbit'),
$oslomsg_rpc_hosts = any2array(hiera('oslo_messaging_rpc_node_names', undef)),
$oslomsg_rpc_password = hiera('oslo_messaging_rpc_password'),
$oslomsg_rpc_port = hiera('oslo_messaging_rpc_port', '5672'),
$oslomsg_rpc_username = hiera('oslo_messaging_rpc_user_name', 'guest'),
$oslomsg_rpc_use_ssl = hiera('oslo_messaging_rpc_use_ssl', '0'),
$oslomsg_notify_proto = hiera('oslo_messaging_notify_scheme', 'rabbit'),
$oslomsg_notify_hosts = any2array(hiera('oslo_messaging_notify_node_names', undef)),
$oslomsg_notify_password = hiera('oslo_messaging_notify_password'),
$oslomsg_notify_port = hiera('oslo_messaging_notify_port', '5672'),
$oslomsg_notify_username = hiera('oslo_messaging_notify_user_name', 'guest'),
$oslomsg_notify_use_ssl = hiera('oslo_messaging_notify_use_ssl', '0'),
$notifier_host_addr = false,
$notifier_host_port = undef,
$event_pipeline_publishers = undef,
$pipeline_publishers = undef,
) {
if $step >= 3 {
@ -110,6 +130,29 @@ class tripleo::profile::base::ceilometer (
'ssl' => $oslomsg_notify_use_ssl_real,
}),
}
if $notifier_host_addr {
class {'::ceilometer::agent::notification' :
event_pipeline_publishers => concat(any2array(os_transport_url({
'transport' => 'notifier',
'host' => $notifier_host_addr,
'port' => $notifier_host_port,
'query' => { 'driver' => 'amqp' },
})), $event_pipeline_publishers),
pipeline_publishers => concat(any2array(os_transport_url({
'transport' => 'notifier',
'host' => $notifier_host_addr,
'port' => $notifier_host_port,
'query' => { 'driver' => 'amqp' },
})), $pipeline_publishers),
}
}
else {
class {'::ceilometer::agent::notification' :
event_pipeline_publishers => $event_pipeline_publishers,
pipeline_publishers => $pipeline_publishers,
}
}
include ::ceilometer::config
include ::ceilometer::dispatcher::gnocchi
include ::ceilometer::logging

View File

@ -76,10 +76,18 @@
# from the router. Each hash should contain 'host', 'role' and 'port' key.
# Defaults to []
#
# [*ssl_profiles*]
# (optional) List of hashes containing configuration for ssl profiles
# Defaults to []
#
# [*addresses*]
# (optional) List of hashes containing configuration for addresses.
# Defaults to []
#
# [*autolink_addresses*]
# (optional) List of hashes containing configuration for autoLinks
# Defaults to []
#
# [*step*]
# (Optional) The current step in deployment. See tripleo-heat-templates
# for more details.
@ -100,7 +108,9 @@ class tripleo::profile::base::metrics::qdr (
$listener_ssl_password = undef,
$listener_trusted_certs = undef,
$connectors = [],
$ssl_profiles = [],
$addresses = [],
$autolink_addresses = [],
$step = Integer(hiera('step')),
) {
if $step >= 1 {
@ -121,7 +131,9 @@ class tripleo::profile::base::metrics::qdr (
#router_mode => 'edge',
router_mode => 'interior',
connectors => $connectors,
ssl_profiles => $ssl_profiles,
extra_addresses => $addresses,
autolink_addresses => $autolink_addresses,
}
qdr_user { $username: