Add support for [statsd] creator

Change-Id: I719ff8386c7ea73cbaeae4d7db8cc6ed82b8cf79
This commit is contained in:
Takashi Kajinami 2022-04-25 08:51:35 +09:00
parent 4bd702bc91
commit bdde282558
3 changed files with 26 additions and 5 deletions

View File

@ -17,6 +17,14 @@
# (optional) Delay between flushes.
# Defaults to $::os_service_default
#
# [*archive_policy_name*]
# (optional) Archive policy name to use when creating metrics.
# Defaults to $::os_service_default.
#
# [*creator*]
# (required) Creator value to use to identify statsd in Gnocchi.
# Defaults to $::os_service_default.
#
# [*enabled*]
# (optional) Should the service be enabled.
# Defaults to true
@ -29,16 +37,13 @@
# (optional) Whether the service should be managed by Puppet.
# Defaults to true.
#
# [*archive_policy_name*]
# (optional) Archive policy name to use when creating metrics.
# Defaults to $::os_service_default.
#
class gnocchi::statsd (
$resource_id,
$host = $::os_service_default,
$port = $::os_service_default,
$flush_delay = $::os_service_default,
$archive_policy_name = $::os_service_default,
$creator = $::os_service_default,
$manage_service = true,
$enabled = true,
$package_ensure = 'present',
@ -73,8 +78,9 @@ class gnocchi::statsd (
'statsd/resource_id' : value => $resource_id;
'statsd/host' : value => $host;
'statsd/port' : value => $port;
'statsd/archive_policy_name' : value => $archive_policy_name;
'statsd/flush_delay' : value => $flush_delay;
'statsd/archive_policy_name' : value => $archive_policy_name;
'statsd/creator' : value => $creator;
}
}

View File

@ -0,0 +1,4 @@
---
features:
- |
The new ``gnocchi::statsd::creator`` parameter has been added.

View File

@ -28,6 +28,7 @@ describe 'gnocchi::statsd' do
is_expected.to contain_gnocchi_config('statsd/port').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('statsd/flush_delay').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('statsd/archive_policy_name').with_value('<SERVICE DEFAULT>')
is_expected.to contain_gnocchi_config('statsd/creator').with_value('<SERVICE DEFAULT>')
end
[{:enabled => true}, {:enabled => false}].each do |param_hash|
@ -94,6 +95,16 @@ describe 'gnocchi::statsd' do
is_expected.to contain_gnocchi_config('statsd/archive_policy_name').with_value('high')
end
end
context 'with creator' do
before do
params.merge!({ :creator => 'creator' })
end
it 'configures the parameter' do
is_expected.to contain_gnocchi_config('statsd/creator').with_value('creator')
end
end
end
on_supported_os({