Add support for [healthcheck] enable_by_file_paths

Depends-on: https://review.opendev.org/923648
Change-Id: I6d7fb809c76ab07139cb1f5253c682894fc0c4da
This commit is contained in:
Takashi Kajinami
2024-07-25 22:41:42 +09:00
parent bbcbe13ecf
commit 3e9e2eeb4f
5 changed files with 28 additions and 0 deletions

View File

@@ -36,6 +36,11 @@
# is running on a port. Expects a "port:path" list of strings.
# Defaults to $facts['os_service_default']
#
# [*enable_by_file_paths*]
# (Optional) Check the presence of files. Used by EnableByFilesHealthcheck
# plugin.
# Defaults to $facts['os_service_default']
#
class ironic::healthcheck (
$enabled = $facts['os_service_default'],
$detailed = $facts['os_service_default'],
@@ -44,6 +49,7 @@ class ironic::healthcheck (
$ignore_proxied_requests = $facts['os_service_default'],
$disable_by_file_path = $facts['os_service_default'],
$disable_by_file_paths = $facts['os_service_default'],
$enable_by_file_paths = $facts['os_service_default'],
) {
include ironic::deps
@@ -59,5 +65,6 @@ class ironic::healthcheck (
ignore_proxied_requests => $ignore_proxied_requests,
disable_by_file_path => $disable_by_file_path,
disable_by_file_paths => $disable_by_file_paths,
enable_by_file_paths => $enable_by_file_paths,
}
}

View File

@@ -36,6 +36,11 @@
# is running on a port. Expects a "port:path" list of strings.
# Defaults to $facts['os_service_default']
#
# [*enable_by_file_paths*]
# (Optional) Check the presence of files. Used by EnableByFilesHealthcheck
# plugin.
# Defaults to $facts['os_service_default']
#
class ironic::inspector::healthcheck (
$enabled = $facts['os_service_default'],
$detailed = $facts['os_service_default'],
@@ -44,6 +49,7 @@ class ironic::inspector::healthcheck (
$ignore_proxied_requests = $facts['os_service_default'],
$disable_by_file_path = $facts['os_service_default'],
$disable_by_file_paths = $facts['os_service_default'],
$enable_by_file_paths = $facts['os_service_default'],
) {
include ironic::deps
@@ -59,5 +65,6 @@ class ironic::inspector::healthcheck (
ignore_proxied_requests => $ignore_proxied_requests,
disable_by_file_path => $disable_by_file_path,
disable_by_file_paths => $disable_by_file_paths,
enable_by_file_paths => $enable_by_file_paths,
}
}

View File

@@ -0,0 +1,8 @@
---
features:
- |
The ``enable_by_file_paths`` parameter has been added to the following
classes.
- ``ironic::healthcheck``
- ``ironic::inspector::healthcheck``

View File

@@ -19,6 +19,7 @@ describe 'ironic::healthcheck' do
:ignore_proxied_requests => '<SERVICE DEFAULT>',
:disable_by_file_path => '<SERVICE DEFAULT>',
:disable_by_file_paths => '<SERVICE DEFAULT>',
:enable_by_file_paths => '<SERVICE DEFAULT>',
)
end
end
@@ -33,6 +34,7 @@ describe 'ironic::healthcheck' do
:ignore_proxied_requests => false,
:disable_by_file_path => '/etc/ironic/healthcheck/disabled',
:disable_by_file_paths => ['8042:/etc/ironic/healthcheck/disabled'],
:enable_by_file_paths => ['/etc/ironic/healthcheck/enabled'],
}
end
@@ -46,6 +48,7 @@ describe 'ironic::healthcheck' do
:ignore_proxied_requests => false,
:disable_by_file_path => '/etc/ironic/healthcheck/disabled',
:disable_by_file_paths => ['8042:/etc/ironic/healthcheck/disabled'],
:enable_by_file_paths => ['/etc/ironic/healthcheck/enabled'],
)
end
end

View File

@@ -19,6 +19,7 @@ describe 'ironic::inspector::healthcheck' do
:ignore_proxied_requests => '<SERVICE DEFAULT>',
:disable_by_file_path => '<SERVICE DEFAULT>',
:disable_by_file_paths => '<SERVICE DEFAULT>',
:enable_by_file_paths => '<SERVICE DEFAULT>',
)
end
end
@@ -33,6 +34,7 @@ describe 'ironic::inspector::healthcheck' do
:ignore_proxied_requests => false,
:disable_by_file_path => '/etc/ironic-inspector/healthcheck/disabled',
:disable_by_file_paths => ['5050:/etc/ironic-inspector/healthcheck/disabled'],
:enable_by_file_paths => ['/etc/ironic-inspector/healthcheck/enabled'],
}
end
@@ -46,6 +48,7 @@ describe 'ironic::inspector::healthcheck' do
:ignore_proxied_requests => false,
:disable_by_file_path => '/etc/ironic-inspector/healthcheck/disabled',
:disable_by_file_paths => ['5050:/etc/ironic-inspector/healthcheck/disabled'],
:enable_by_file_paths => ['/etc/ironic-inspector/healthcheck/enabled'],
)
end
end