healthcheck: Expose ignore_proxied_requests parameter

Depends-on: https://review.opendev.org/909807
Change-Id: Ifb42750a7767579bb31f79a68f4042c8f6e8caa1
This commit is contained in:
Takashi Kajinami
2024-02-22 11:24:54 +09:00
parent 7031f2a360
commit 9d14c5f8e1
3 changed files with 39 additions and 25 deletions

View File

@@ -18,6 +18,10 @@
# healthcheck information.
# Defaults to $facts['os_service_default']
#
# [*ignore_proxied_requests*]
# (Optional) Ignore requests with proxy headers
# Defaults to $facts['os_service_default']
#
# [*disable_by_file_path*]
# (Optional) Check the presence of a file to determine if an application
# is running on a port.
@@ -29,20 +33,22 @@
# Defaults to $facts['os_service_default']
#
class aodh::healthcheck (
$detailed = $facts['os_service_default'],
$backends = $facts['os_service_default'],
$allowed_source_ranges = $facts['os_service_default'],
$disable_by_file_path = $facts['os_service_default'],
$disable_by_file_paths = $facts['os_service_default'],
$detailed = $facts['os_service_default'],
$backends = $facts['os_service_default'],
$allowed_source_ranges = $facts['os_service_default'],
$ignore_proxied_requests = $facts['os_service_default'],
$disable_by_file_path = $facts['os_service_default'],
$disable_by_file_paths = $facts['os_service_default'],
) {
include aodh::deps
oslo::healthcheck { 'aodh_config':
detailed => $detailed,
backends => $backends,
allowed_source_ranges => $allowed_source_ranges,
disable_by_file_path => $disable_by_file_path,
disable_by_file_paths => $disable_by_file_paths,
detailed => $detailed,
backends => $backends,
allowed_source_ranges => $allowed_source_ranges,
ignore_proxied_requests => $ignore_proxied_requests,
disable_by_file_path => $disable_by_file_path,
disable_by_file_paths => $disable_by_file_paths,
}
}

View File

@@ -0,0 +1,5 @@
---
features:
- |
The new ``aodh::healthcheck::ignore_proxied_requests`` parameter has been
added.

View File

@@ -11,11 +11,12 @@ describe 'aodh::healthcheck' do
it 'configures default values' do
is_expected.to contain_oslo__healthcheck('aodh_config').with(
:detailed => '<SERVICE DEFAULT>',
:backends => '<SERVICE DEFAULT>',
:allowed_source_ranges => '<SERVICE DEFAULT>',
:disable_by_file_path => '<SERVICE DEFAULT>',
:disable_by_file_paths => '<SERVICE DEFAULT>',
:detailed => '<SERVICE DEFAULT>',
:backends => '<SERVICE DEFAULT>',
:allowed_source_ranges => '<SERVICE DEFAULT>',
:ignore_proxied_requests => '<SERVICE DEFAULT>',
:disable_by_file_path => '<SERVICE DEFAULT>',
:disable_by_file_paths => '<SERVICE DEFAULT>',
)
end
end
@@ -23,21 +24,23 @@ describe 'aodh::healthcheck' do
context 'with specific parameters' do
let :params do
{
:detailed => true,
:backends => ['disable_by_file'],
:allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'],
:disable_by_file_path => '/etc/aodh/healthcheck/disabled',
:disable_by_file_paths => ['8042:/etc/aodh/healthcheck/disabled'],
:detailed => true,
:backends => ['disable_by_file'],
:allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'],
:ignore_proxied_requests => false,
:disable_by_file_path => '/etc/aodh/healthcheck/disabled',
:disable_by_file_paths => ['8042:/etc/aodh/healthcheck/disabled'],
}
end
it 'configures specified values' do
is_expected.to contain_oslo__healthcheck('aodh_config').with(
:detailed => true,
:backends => ['disable_by_file'],
:allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'],
:disable_by_file_path => '/etc/aodh/healthcheck/disabled',
:disable_by_file_paths => ['8042:/etc/aodh/healthcheck/disabled'],
:detailed => true,
:backends => ['disable_by_file'],
:allowed_source_ranges => ['10.0.0.0/24', '10.0.1.0/24'],
:ignore_proxied_requests => false,
:disable_by_file_path => '/etc/aodh/healthcheck/disabled',
:disable_by_file_paths => ['8042:/etc/aodh/healthcheck/disabled'],
)
end
end