Add recipes for alarm services

The telemetry cookbook currently lacks recipes for the alarm and the
agent notification services. This patch adds them as well as their
corresponding specs and documentation.

Implements blueprint alarm-sevices

Change-Id: I2896db6e95f52f4488ec8bb9bcb88c697cb712b6
This commit is contained in:
Luis A. Garcia 2014-03-26 00:04:16 +00:00
parent 8417ededbe
commit fc302f9550
16 changed files with 328 additions and 1 deletions

View File

@ -1,6 +1,11 @@
openstack-telemetry Cookbook CHANGELG
==============================
This file is used to list changes made in each version of the openstack-metering cookbook.
## 9.1.0
### Blue print
# Add recipes for the ceilometer alarm services (alarm-services)
# Add recipes for the ceilometer agent notification service (alarm-services)
## 9.0.0
* Upgrade to Icehouse

View File

@ -24,6 +24,18 @@ agent-compute
----
- Installs agent compute service.
agent-notification
----
- Installs agent notification service.
alarm-evaluator
----
- Installs alarm evaluator service.
alarm-notifier
----
- Installs alarm notifier service.
api
----
- Installs API service.

View File

@ -57,12 +57,19 @@ when 'suse' # :pragma-foodcritic: ~FC024 - won't fix this
'agent_central_service' => 'openstack-ceilometer-agent-central',
'agent_compute_packages' => ['openstack-ceilometer-agent-compute'],
'agent_compute_service' => 'openstack-ceilometer-agent-compute',
'agent_notification_packages' => ['openstack-ceilometer-agent-notification'],
'agent_notification_service' => 'openstack-ceilometer-agent-notification',
'alarm_evaluator_packages' => ['openstack-ceilometer-alarm-evaluator'],
'alarm_evaluator_service' => 'openstack-ceilometer-alarm-evaluator',
'alarm_notifier_packages' => ['openstack-ceilometer-alarm-notifier'],
'alarm_notifier_service' => 'openstack-ceilometer-alarm-notifier',
'api_packages' => ['openstack-ceilometer-api'],
'api_service' => 'openstack-ceilometer-api',
'client_packages' => ['python-ceilometerclient'],
'collector_packages' => ['openstack-ceilometer-collector'],
'collector_service' => 'openstack-ceilometer-collector'
}
when 'fedora', 'redhat', 'centos'
default['openstack']['telemetry']['platform'] = {
'common_packages' => ['openstack-ceilometer-common'],
@ -70,6 +77,12 @@ when 'fedora', 'redhat', 'centos'
'agent_central_service' => 'openstack-ceilometer-central',
'agent_compute_packages' => ['openstack-ceilometer-compute'],
'agent_compute_service' => 'openstack-ceilometer-compute',
'agent_notification_packages' => ['openstack-ceilometer-collector'],
'agent_notification_service' => 'openstack-ceilometer-notification',
'alarm_evaluator_packages' => ['openstack-ceilometer-alarm'],
'alarm_evaluator_service' => 'openstack-ceilometer-alarm-evaluator',
'alarm_notifier_packages' => ['openstack-ceilometer-alarm'],
'alarm_notifier_service' => 'openstack-ceilometer-alarm-notifier',
'api_packages' => ['openstack-ceilometer-api'],
'api_service' => 'openstack-ceilometer-api',
'client_packages' => ['python-ceilometerclient'],
@ -84,6 +97,12 @@ when 'ubuntu'
'agent_central_service' => 'ceilometer-agent-central',
'agent_compute_packages' => ['ceilometer-agent-compute'],
'agent_compute_service' => 'ceilometer-agent-compute',
'agent_notification_packages' => ['ceilometer-agent-notification'],
'agent_notification_service' => 'ceilometer-agent-notification',
'alarm_evaluator_packages' => ['ceilometer-alarm-evaluator'],
'alarm_evaluator_service' => 'ceilometer-alarm-evaluator',
'alarm_notifier_packages' => ['ceilometer-alarm-notifier'],
'alarm_notifier_service' => 'ceilometer-alarm-notifier',
'api_packages' => ['ceilometer-api'],
'api_service' => 'ceilometer-api',
'client_packages' => ['python-ceilometerclient'],

View File

@ -4,13 +4,16 @@ maintainer_email 'cookbooks@lists.tfoundry.com'
license 'Apache 2.0'
description 'The OpenStack Metering service Ceilometer.'
long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
version '9.0.0'
version '9.1.0'
recipe 'openstack-telemetry::agent-central', 'Installs agent central service.'
recipe 'openstack-telemetry::agent-compute', 'Installs agent compute service.'
recipe 'openstack-telemetry::agent-notification', 'Installs the agent notification service.'
recipe 'openstack-telemetry::api', 'Installs API service.'
recipe 'openstack-telemetry::client', 'Installs client.'
recipe 'openstack-telemetry::collector', 'Installs collector service. If the NoSQL database is used for metering service, ceilometer-dbsync will not be executed.'
recipe 'openstack-telemetry::alarm-evaluator', 'Installs the alarm evaluator service.'
recipe 'openstack-telemetry::alarm-notifier', 'Installs the alarm notifier service.'
recipe 'openstack-telemetry::common', 'Common metering configuration.'
recipe 'openstack-telemetry::identity_registration', 'Registers the endpoints, tenant and user for metering service with Keystone'

View File

@ -0,0 +1,31 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-telemetry
# Recipe:: agent-notification
#
# Copyright 2014, IBM Corp.
#
# 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.
#
include_recipe 'openstack-telemetry::common'
platform = node['openstack']['telemetry']['platform']
platform['agent_notification_packages'].each do |pkg|
package pkg
end
service platform['agent_notification_service'] do
supports status: true, restart: true
action :start
end

View File

@ -0,0 +1,31 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-telemetry
# Recipe:: alarm-evaluator
#
# Copyright 2014, IBM Corp.
#
# 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.
#
include_recipe 'openstack-telemetry::common'
platform = node['openstack']['telemetry']['platform']
platform['alarm_evaluator_packages'].each do |pkg|
package pkg
end
service platform['alarm_evaluator_service'] do
supports status: true, restart: true
action :start
end

31
recipes/alarm-notifier.rb Normal file
View File

@ -0,0 +1,31 @@
# encoding: UTF-8
#
# Cookbook Name:: openstack-telemetry
# Recipe:: alarm-notifier
#
# Copyright 2014, IBM Corp.
#
# 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.
#
include_recipe 'openstack-telemetry::common'
platform = node['openstack']['telemetry']['platform']
platform['alarm_notifier_packages'].each do |pkg|
package pkg
end
service platform['alarm_notifier_service'] do
supports status: true, restart: true
action :start
end

View File

@ -0,0 +1,22 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-notification' do
describe 'rhel' do
let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the agent-notification package' do
expect(chef_run).to install_package 'openstack-ceilometer-collector'
end
it 'starts the agent-notification service' do
expect(chef_run).to start_service 'openstack-ceilometer-notification'
end
end
end

View File

@ -0,0 +1,21 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-notification' do
describe 'suse' do
let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
it 'installs the agent-notification package' do
expect(chef_run).to install_package 'openstack-ceilometer-agent-notification'
end
it 'starts the agent-notification service' do
expect(chef_run).to start_service 'openstack-ceilometer-agent-notification'
end
end
end

View File

@ -0,0 +1,22 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::agent-notification' do
describe 'ubuntu' do
let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the agent-notification package' do
expect(chef_run).to install_package 'ceilometer-agent-notification'
end
it 'starts ceilometer-agent-notification service' do
expect(chef_run).to start_service('ceilometer-agent-notification')
end
end
end

View File

@ -0,0 +1,22 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::alarm-evaluator' do
describe 'rhel' do
let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the alarm-evaluator package' do
expect(chef_run).to install_package 'openstack-ceilometer-alarm'
end
it 'starts the alarm-evaluator service' do
expect(chef_run).to start_service 'openstack-ceilometer-alarm-evaluator'
end
end
end

View File

@ -0,0 +1,21 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::alarm-evaluator' do
describe 'suse' do
let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
it 'installs the alarm-evaluator package' do
expect(chef_run).to install_package 'openstack-ceilometer-alarm-evaluator'
end
it 'starts the alarm-evaluator service' do
expect(chef_run).to start_service 'openstack-ceilometer-alarm-evaluator'
end
end
end

View File

@ -0,0 +1,22 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::alarm-evaluator' do
describe 'ubuntu' do
let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the alarm-evaluator package' do
expect(chef_run).to install_package 'ceilometer-alarm-evaluator'
end
it 'starts alarm-evaluator service' do
expect(chef_run).to start_service('ceilometer-alarm-evaluator')
end
end
end

View File

@ -0,0 +1,22 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::alarm-notifier' do
describe 'rhel' do
let(:runner) { ChefSpec::Runner.new(REDHAT_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the alarm-notifier package' do
expect(chef_run).to install_package 'openstack-ceilometer-alarm'
end
it 'starts the alarm-notifier service' do
expect(chef_run).to start_service 'openstack-ceilometer-alarm-notifier'
end
end
end

View File

@ -0,0 +1,21 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::alarm-notifier' do
describe 'suse' do
let(:runner) { ChefSpec::Runner.new(SUSE_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
it 'installs the alarm-notifier package' do
expect(chef_run).to install_package 'openstack-ceilometer-alarm-notifier'
end
it 'starts the alarm-notifier service' do
expect(chef_run).to start_service 'openstack-ceilometer-alarm-notifier'
end
end
end

View File

@ -0,0 +1,22 @@
# encoding: UTF-8
require_relative 'spec_helper'
describe 'openstack-telemetry::alarm-notifier' do
describe 'ubuntu' do
let(:runner) { ChefSpec::Runner.new(UBUNTU_OPTS) }
let(:node) { runner.node }
let(:chef_run) { runner.converge(described_recipe) }
include_context 'telemetry-stubs'
include_examples 'expect-runs-common-recipe'
it 'installs the alarm-notifier package' do
expect(chef_run).to install_package 'ceilometer-alarm-notifier'
end
it 'starts alarm-notifier service' do
expect(chef_run).to start_service('ceilometer-alarm-notifier')
end
end
end