Skip to content
This repository has been archived by the owner on Mar 5, 2024. It is now read-only.

Commit

Permalink
Add recipes for alarm services
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Luis A. Garcia committed Apr 3, 2014
1 parent 8417ede commit fc302f9
Show file tree
Hide file tree
Showing 16 changed files with 328 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -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

Expand Down
12 changes: 12 additions & 0 deletions README.md
Expand Up @@ -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.
Expand Down
19 changes: 19 additions & 0 deletions attributes/default.rb
Expand Up @@ -57,19 +57,32 @@
'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'],
'agent_central_packages' => ['openstack-ceilometer-central'],
'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'],
Expand All @@ -84,6 +97,12 @@
'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'],
Expand Down
5 changes: 4 additions & 1 deletion metadata.rb
Expand Up @@ -4,13 +4,16 @@
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'

Expand Down
31 changes: 31 additions & 0 deletions recipes/agent-notification.rb
@@ -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
31 changes: 31 additions & 0 deletions recipes/alarm-evaluator.rb
@@ -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 changes: 31 additions & 0 deletions recipes/alarm-notifier.rb
@@ -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
22 changes: 22 additions & 0 deletions spec/agent-notification-rhel_spec.rb
@@ -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
21 changes: 21 additions & 0 deletions spec/agent-notification-suse_spec.rb
@@ -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
22 changes: 22 additions & 0 deletions spec/agent-notification_spec.rb
@@ -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
22 changes: 22 additions & 0 deletions spec/alarm-evaluator-rhel_spec.rb
@@ -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
21 changes: 21 additions & 0 deletions spec/alarm-evaluator-suse_spec.rb
@@ -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
22 changes: 22 additions & 0 deletions spec/alarm-evaluator_spec.rb
@@ -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
22 changes: 22 additions & 0 deletions spec/alarm-notifier-rhel_spec.rb
@@ -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
21 changes: 21 additions & 0 deletions spec/alarm-notifier-suse_spec.rb
@@ -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
22 changes: 22 additions & 0 deletions spec/alarm-notifier_spec.rb
@@ -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

0 comments on commit fc302f9

Please sign in to comment.