Add event_pipeline.yaml management
Allow event_pipeline.yaml to have publishers specified. This is required to support aodh event alarms by pushing notifications to an alarm queue as described here: http://docs.openstack.org/developer/aodh/event-alarm.html Change-Id: If367192f9c0214b3b4462788024dd9222dff558e Signed-off-by: Michael Chapman <woppin@gmail.com>
This commit is contained in:
parent
652c497fe3
commit
0148969baf
@ -57,6 +57,16 @@
|
|||||||
# (Optional) ensure state for package.
|
# (Optional) ensure state for package.
|
||||||
# Defaults to 'present'.
|
# Defaults to 'present'.
|
||||||
#
|
#
|
||||||
|
# [*manage_event_pipeline*]
|
||||||
|
# (Optional) Whether to manage event_pipeline.yaml
|
||||||
|
# Defaults to false
|
||||||
|
#
|
||||||
|
# [*event_pipeline_publishers*]
|
||||||
|
# (Optional) A list of publishers to put in event_pipeline.yaml
|
||||||
|
# Add 'notifier://?topic=alarm.all' to the list if you are using Aodh
|
||||||
|
# for alarms.
|
||||||
|
# Defaults to ['notifier://'],
|
||||||
|
#
|
||||||
class ceilometer::agent::notification (
|
class ceilometer::agent::notification (
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
$enabled = true,
|
$enabled = true,
|
||||||
@ -66,6 +76,8 @@ class ceilometer::agent::notification (
|
|||||||
$notification_workers = $::os_service_default,
|
$notification_workers = $::os_service_default,
|
||||||
$messaging_urls = $::os_service_default,
|
$messaging_urls = $::os_service_default,
|
||||||
$package_ensure = 'present',
|
$package_ensure = 'present',
|
||||||
|
$manage_event_pipeline = false,
|
||||||
|
$event_pipeline_publishers = ['notifier://'],
|
||||||
) {
|
) {
|
||||||
|
|
||||||
include ::ceilometer::params
|
include ::ceilometer::params
|
||||||
@ -100,6 +112,20 @@ class ceilometer::agent::notification (
|
|||||||
tag => 'ceilometer-service'
|
tag => 'ceilometer-service'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($manage_event_pipeline) {
|
||||||
|
validate_array($event_pipeline_publishers)
|
||||||
|
|
||||||
|
file { 'event_pipeline':
|
||||||
|
ensure => present,
|
||||||
|
path => $::ceilometer::params::event_pipeline,
|
||||||
|
content => template('ceilometer/event_pipeline.yaml.erb'),
|
||||||
|
selinux_ignore_defaults => true
|
||||||
|
}
|
||||||
|
|
||||||
|
Package<| tag == 'ceilometer-package' |> -> File['event_pipeline']
|
||||||
|
File['event_pipeline'] ~> Service['ceilometer-agent-notification']
|
||||||
|
}
|
||||||
|
|
||||||
ceilometer_config {
|
ceilometer_config {
|
||||||
'notification/ack_on_event_error' : value => $ack_on_event_error;
|
'notification/ack_on_event_error' : value => $ack_on_event_error;
|
||||||
'notification/store_events' : value => $store_events;
|
'notification/store_events' : value => $store_events;
|
||||||
|
@ -9,6 +9,7 @@ class ceilometer::params {
|
|||||||
$dbsync_command = 'ceilometer-dbsync --config-file=/etc/ceilometer/ceilometer.conf'
|
$dbsync_command = 'ceilometer-dbsync --config-file=/etc/ceilometer/ceilometer.conf'
|
||||||
$expirer_command = 'ceilometer-expirer'
|
$expirer_command = 'ceilometer-expirer'
|
||||||
$user = 'ceilometer'
|
$user = 'ceilometer'
|
||||||
|
$event_pipeline = '/etc/ceilometer/event_pipeline.yaml'
|
||||||
|
|
||||||
case $::osfamily {
|
case $::osfamily {
|
||||||
'RedHat': {
|
'RedHat': {
|
||||||
|
3
releasenotes/notes/event-pipeline-d49e4bb90fddbb0b.yaml
Normal file
3
releasenotes/notes/event-pipeline-d49e4bb90fddbb0b.yaml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- Add the ability to manage publishers in event_pipeline.yaml
|
@ -111,6 +111,65 @@ describe 'ceilometer::agent::notification' do
|
|||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context "with event_pipeline management enabled" do
|
||||||
|
before { params.merge!(
|
||||||
|
:manage_event_pipeline => true
|
||||||
|
) }
|
||||||
|
|
||||||
|
it { is_expected.to contain_file('event_pipeline').with(
|
||||||
|
'path' => '/etc/ceilometer/event_pipeline.yaml',
|
||||||
|
) }
|
||||||
|
|
||||||
|
it { 'configures event_pipeline with the default notifier'
|
||||||
|
verify_contents(catalogue, 'event_pipeline', [
|
||||||
|
"---",
|
||||||
|
"sources:",
|
||||||
|
" - name: event_source",
|
||||||
|
" events:",
|
||||||
|
" - \"*\"",
|
||||||
|
" sinks:",
|
||||||
|
" - event_sink",
|
||||||
|
"sinks:",
|
||||||
|
" - name: event_sink",
|
||||||
|
" transformers:",
|
||||||
|
" triggers:",
|
||||||
|
" publishers:",
|
||||||
|
" - notifier://",
|
||||||
|
])}
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with multiple event_pipeline publishers specified" do
|
||||||
|
before { params.merge!(
|
||||||
|
:manage_event_pipeline => true,
|
||||||
|
:event_pipeline_publishers => ['notifier://', 'notifier://?topic=alarm.all']
|
||||||
|
) }
|
||||||
|
|
||||||
|
it { 'configures event_pipeline with multiple publishers'
|
||||||
|
verify_contents(catalogue, 'event_pipeline', [
|
||||||
|
"---",
|
||||||
|
"sources:",
|
||||||
|
" - name: event_source",
|
||||||
|
" events:",
|
||||||
|
" - \"*\"",
|
||||||
|
" sinks:",
|
||||||
|
" - event_sink",
|
||||||
|
"sinks:",
|
||||||
|
" - name: event_sink",
|
||||||
|
" transformers:",
|
||||||
|
" triggers:",
|
||||||
|
" publishers:",
|
||||||
|
" - notifier://",
|
||||||
|
" - notifier://?topic=alarm.all",
|
||||||
|
])}
|
||||||
|
end
|
||||||
|
|
||||||
|
context "with event_pipeline management disabled" do
|
||||||
|
before { params.merge!(
|
||||||
|
:manage_event_pipeline => false
|
||||||
|
) }
|
||||||
|
it { is_expected.not_to contain_file('event_pipeline') }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'on Debian platforms' do
|
context 'on Debian platforms' do
|
||||||
|
15
templates/event_pipeline.yaml.erb
Normal file
15
templates/event_pipeline.yaml.erb
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
---
|
||||||
|
sources:
|
||||||
|
- name: event_source
|
||||||
|
events:
|
||||||
|
- "*"
|
||||||
|
sinks:
|
||||||
|
- event_sink
|
||||||
|
sinks:
|
||||||
|
- name: event_sink
|
||||||
|
transformers:
|
||||||
|
triggers:
|
||||||
|
publishers:
|
||||||
|
<% @event_pipeline_publishers.each do |publisher| -%>
|
||||||
|
- <%= publisher %>
|
||||||
|
<% end -%>
|
Loading…
x
Reference in New Issue
Block a user