statsd: Add support for host and port
This change introduces support for the following two parameters. - [statsd] host - [statsd] port Change-Id: Ia4e4a5d5ae40a7d4a358569d9caacb07ff391d6a
This commit is contained in:
parent
bce487db88
commit
4bd702bc91
|
@ -5,6 +5,14 @@
|
||||||
# [*resource_id*]
|
# [*resource_id*]
|
||||||
# (required) Resource UUID to use to identify statsd in Gnocchi.
|
# (required) Resource UUID to use to identify statsd in Gnocchi.
|
||||||
#
|
#
|
||||||
|
# [*host*]
|
||||||
|
# (optional) The listen IP for statsd.
|
||||||
|
# Defaults to $::os_service_default
|
||||||
|
#
|
||||||
|
# [*port*]
|
||||||
|
# (optional) The port for statsd.
|
||||||
|
# Defaults to $::os_service_default.
|
||||||
|
#
|
||||||
# [*flush_delay*]
|
# [*flush_delay*]
|
||||||
# (optional) Delay between flushes.
|
# (optional) Delay between flushes.
|
||||||
# Defaults to $::os_service_default
|
# Defaults to $::os_service_default
|
||||||
|
@ -27,6 +35,8 @@
|
||||||
#
|
#
|
||||||
class gnocchi::statsd (
|
class gnocchi::statsd (
|
||||||
$resource_id,
|
$resource_id,
|
||||||
|
$host = $::os_service_default,
|
||||||
|
$port = $::os_service_default,
|
||||||
$flush_delay = $::os_service_default,
|
$flush_delay = $::os_service_default,
|
||||||
$archive_policy_name = $::os_service_default,
|
$archive_policy_name = $::os_service_default,
|
||||||
$manage_service = true,
|
$manage_service = true,
|
||||||
|
@ -61,6 +71,8 @@ class gnocchi::statsd (
|
||||||
|
|
||||||
gnocchi_config {
|
gnocchi_config {
|
||||||
'statsd/resource_id' : value => $resource_id;
|
'statsd/resource_id' : value => $resource_id;
|
||||||
|
'statsd/host' : value => $host;
|
||||||
|
'statsd/port' : value => $port;
|
||||||
'statsd/archive_policy_name' : value => $archive_policy_name;
|
'statsd/archive_policy_name' : value => $archive_policy_name;
|
||||||
'statsd/flush_delay' : value => $flush_delay;
|
'statsd/flush_delay' : value => $flush_delay;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``gnocchi::statsd`` class now supports ``host`` and ``port``.
|
|
@ -24,6 +24,8 @@ describe 'gnocchi::statsd' do
|
||||||
|
|
||||||
it 'configures gnocchi statsd' do
|
it 'configures gnocchi statsd' do
|
||||||
is_expected.to contain_gnocchi_config('statsd/resource_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9')
|
is_expected.to contain_gnocchi_config('statsd/resource_id').with_value('07f26121-5777-48ba-8a0b-d70468133dd9')
|
||||||
|
is_expected.to contain_gnocchi_config('statsd/host').with_value('<SERVICE DEFAULT>')
|
||||||
|
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/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/archive_policy_name').with_value('<SERVICE DEFAULT>')
|
||||||
end
|
end
|
||||||
|
@ -59,6 +61,20 @@ describe 'gnocchi::statsd' do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
context 'whth host and port' do
|
||||||
|
before do
|
||||||
|
params.merge!({
|
||||||
|
:host => '192.0.2.1',
|
||||||
|
:port => 8125,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'configures the parameter' do
|
||||||
|
is_expected.to contain_gnocchi_config('statsd/host').with_value('192.0.2.1')
|
||||||
|
is_expected.to contain_gnocchi_config('statsd/port').with_value(8125)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
context 'with flush_delay' do
|
context 'with flush_delay' do
|
||||||
before do
|
before do
|
||||||
params.merge!({ :flush_delay => 10 })
|
params.merge!({ :flush_delay => 10 })
|
||||||
|
|
Loading…
Reference in New Issue