Add support for [pooling] ignore_disabled_projects

... which was added during this cycle.

Depends-on: https://review.opendev.org/934670
Change-Id: I6424527afc452621e207b1368b83af85db99a926
This commit is contained in:
Takashi Kajinami
2025-03-10 18:36:32 +09:00
parent fd06f2fcbc
commit d361dbb4cd
3 changed files with 15 additions and 0 deletions

View File

@@ -86,6 +86,11 @@
# (Optional) Identify user and project names from polled metrics.
# Defaults to $facts['os_service_default'].
#
# [*ignore_disabled_projects*]
# (Optional) Whether the pooling service should ignore disabled projects or
# not.
# Defaults to $facts['os_service_default'].
#
# [*enable_notifications*]
# (Optional) Whether the polling service should be sending notifications.
# Defaults to $facts['os_service_default'].
@@ -123,6 +128,7 @@ class ceilometer::agent::polling (
$cfg_file = $facts['os_service_default'],
$batch_size = $facts['os_service_default'],
$tenant_name_discovery = $facts['os_service_default'],
$ignore_disabled_projects = $facts['os_service_default'],
$enable_notifications = $facts['os_service_default'],
$enable_prometheus_exporter = $facts['os_service_default'],
$prometheus_listen_addresses = $facts['os_service_default'],
@@ -238,6 +244,7 @@ class ceilometer::agent::polling (
ceilometer_config {
'polling/batch_size': value => $batch_size;
'polling/tenant_name_discovery': value => $tenant_name_discovery;
'polling/ignore_disabled_projects': value => $ignore_disabled_projects;
'polling/pollsters_definitions_dirs': value => join(any2array($pollsters_definitions_dirs), ',');
'polling/enable_notifications': value => $enable_notifications;
'polling/enable_prometheus_exporter': value => $enable_prometheus_exporter;

View File

@@ -0,0 +1,5 @@
---
features:
- |
The new ``ceilometer::agent::polling::ignore_disabled_projects`` parameter
has been added.

View File

@@ -73,6 +73,7 @@ describe 'ceilometer::agent::polling' do
it { should contain_ceilometer_config('polling/batch_size').with_value('<SERVICE DEFAULT>') }
it { should_not contain_file('polling') }
it { should contain_ceilometer_config('polling/tenant_name_discovery').with_value('<SERVICE DEFAULT>') }
it { should contain_ceilometer_config('polling/ignore_disabled_projects').with_value('<SERVICE DEFAULT>') }
it { should contain_ceilometer_config('polling/enable_notifications').with_value('<SERVICE DEFAULT>') }
it { should contain_ceilometer_config('polling/enable_prometheus_exporter').with_value('<SERVICE DEFAULT>') }
it { should contain_ceilometer_config('polling/prometheus_listen_addresses').with_value('<SERVICE DEFAULT>') }
@@ -110,6 +111,7 @@ describe 'ceilometer::agent::polling' do
before do
params.merge!(
:tenant_name_discovery => true,
:ignore_disabled_projects => false,
:enable_notifications => true,
:enable_prometheus_exporter => false,
:prometheus_listen_addresses => ['127.0.0.1:9101'],
@@ -119,6 +121,7 @@ describe 'ceilometer::agent::polling' do
it {
should contain_ceilometer_config('polling/tenant_name_discovery').with_value(true)
should contain_ceilometer_config('polling/ignore_disabled_projects').with_value(false)
should contain_ceilometer_config('polling/enable_notifications').with_value(true)
should contain_ceilometer_config('polling/enable_prometheus_exporter').with_value(false)
should contain_ceilometer_config('polling/prometheus_listen_addresses').with_value('127.0.0.1:9101')