Add support for the [service_types] parameters
Change-Id: Ia81c9c3da067cacf131262a0ad9cfa575ff3c246
This commit is contained in:
parent
d481b0cec1
commit
89923f7eb1
44
manifests/agent/polling/service_types.pp
Normal file
44
manifests/agent/polling/service_types.pp
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# == Class: ceilometer::agent::polling::service_types
|
||||||
|
#
|
||||||
|
# Configure service_types parameters
|
||||||
|
#
|
||||||
|
# === Parameters
|
||||||
|
#
|
||||||
|
# [*glance*]
|
||||||
|
# (Optional) glance service type.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
|
# [*neutron*]
|
||||||
|
# (Optional) neutron service type.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
|
# [*nova*]
|
||||||
|
# (Optional) nova service type.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
|
# [*swift*]
|
||||||
|
# (Optional) swift service type.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
|
# [*cinder*]
|
||||||
|
# (Optional) cinder service type.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
|
class ceilometer::agent::polling::service_types (
|
||||||
|
$glance = $::os_service_default,
|
||||||
|
$neutron = $::os_service_default,
|
||||||
|
$nova = $::os_service_default,
|
||||||
|
$swift = $::os_service_default,
|
||||||
|
$cinder = $::os_service_default,
|
||||||
|
) {
|
||||||
|
|
||||||
|
include ceilometer::deps
|
||||||
|
|
||||||
|
ceilometer_config {
|
||||||
|
'service_types/glance': value => $glance;
|
||||||
|
'service_types/neutron': value => $neutron;
|
||||||
|
'service_types/nova': value => $nova;
|
||||||
|
'service_types/swift': value => $swift;
|
||||||
|
'service_types/cinder': value => $cinder;
|
||||||
|
}
|
||||||
|
}
|
5
releasenotes/notes/service_types-2a672cdceff9227f.yaml
Normal file
5
releasenotes/notes/service_types-2a672cdceff9227f.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The new ``ceilometer::agent::polling::service_types`` class, to manage
|
||||||
|
parameters in the ``[service_types]`` section, has been added.
|
47
spec/classes/ceilometer_agent_polling_service_types_spec.rb
Normal file
47
spec/classes/ceilometer_agent_polling_service_types_spec.rb
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
describe 'ceilometer::agent::polling::service_types' do
|
||||||
|
shared_examples 'ceilometer::agent::polling::service_types' do
|
||||||
|
context 'with default parameters' do
|
||||||
|
it 'configures the default values' do
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/glance').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/neutron').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/nova').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/swift').with_value('<SERVICE DEFAULT>')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/cinder').with_value('<SERVICE DEFAULT>')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'with overridden parameters' do
|
||||||
|
let :params do
|
||||||
|
{
|
||||||
|
:glance => 'image',
|
||||||
|
:neutron => 'network',
|
||||||
|
:nova => 'compute',
|
||||||
|
:swift => 'object-store',
|
||||||
|
:cinder => 'volumev3',
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures the overridden values' do
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/glance').with_value('image')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/neutron').with_value('network')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/nova').with_value('compute')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/swift').with_value('object-store')
|
||||||
|
is_expected.to contain_ceilometer_config('service_types/cinder').with_value('volumev3')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
on_supported_os({
|
||||||
|
:supported_os => OSDefaults.get_supported_os
|
||||||
|
}).each do |os,facts|
|
||||||
|
context "on #{os}" do
|
||||||
|
let (:facts) do
|
||||||
|
facts.merge(OSDefaults.get_facts())
|
||||||
|
end
|
||||||
|
|
||||||
|
it_behaves_like 'ceilometer::agent::polling::service_types'
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
x
Reference in New Issue
Block a user