Neutron: Enable metering agent only when Telemetry is enabled

The metering-agent service is an optional service to gather metrics in
Telemetry(ceilometer + gnocchi), thus is usually disabled if Telemetry
is disabled.

This change disables the service in the scenarios without Telemetry so
that we can validate deployments without this optional service.

Change-Id: I6f1bb575b891318ac83e26450d7b0699a1911b66
This commit is contained in:
Takashi Kajinami 2023-02-13 17:35:12 +09:00
parent 863628b2fe
commit 891c32918a
4 changed files with 24 additions and 7 deletions

View File

@ -69,6 +69,7 @@ class { 'openstack_integration::glance':
}
class { 'openstack_integration::neutron':
notification_topics => $notification_topics,
metering_enabled => true,
}
include openstack_integration::placement
class { 'openstack_integration::nova':

View File

@ -57,7 +57,9 @@ class { 'openstack_integration::glance':
backend => 'swift',
image_encryption => true,
}
include openstack_integration::neutron
class { 'openstack_integration::neutron':
metering_enabled => true,
}
include openstack_integration::swift
include openstack_integration::ironic
include openstack_integration::zaqar

View File

@ -5,6 +5,10 @@
# Can be: openvswitch, linuxbridge or ovn.
# Defaults to 'openvswitch'.
#
# [*metering_enabled*]
# (optional) Flag to enable metering agent
# Defaults to false.
#
# [*bgpvpn_enabled*]
# (optional) Flag to enable BGPVPN
# API extensions.
@ -24,6 +28,7 @@
#
class openstack_integration::neutron (
$driver = 'openvswitch',
$metering_enabled = false,
$bgpvpn_enabled = false,
$l2gw_enabled = false,
$bgp_dragent_enabled = false,
@ -115,7 +120,10 @@ class openstack_integration::neutron (
$providers_list = undef
} else {
$dhcp_agent_notification = true
$metering_plugin = $metering_enabled ? {
true => 'metering',
default => undef,
}
$bgpvpn_plugin = $bgpvpn_enabled ? {
true => 'bgpvpn',
default => undef,
@ -144,7 +152,7 @@ class openstack_integration::neutron (
default => undef,
}
$plugins_list = delete_undef_values(['router', 'metering', 'qos', 'trunk', $bgpvpn_plugin, $l2gw_plugin, $bgp_dr_plugin])
$plugins_list = delete_undef_values(['router', 'qos', 'trunk', $metering_plugin, $bgpvpn_plugin, $l2gw_plugin, $bgp_dr_plugin])
}
if $driver == 'linuxbridge' {
@ -311,9 +319,12 @@ class openstack_integration::neutron (
interface_driver => $driver,
debug => true,
}
class { 'neutron::agents::metering':
interface_driver => $driver,
debug => true,
if $metering_enabled {
class { 'neutron::agents::metering':
interface_driver => $driver,
debug => true,
}
}
}
class { 'neutron::server::notifications::nova':

View File

@ -236,7 +236,10 @@ class openstack_integration::tempest (
} else {
$neutron_agent_scheduler_extensions = ['dhcp_agent_scheduler', 'l3_agent_scheduler']
$neutron_l3_extensions = ['dvr', 'l3-flavors', 'l3-ha']
$neutron_metering_extensions = ['metering']
$neutron_metering_extensions = $ceilometer ? {
true => ['metering'],
default => []
}
}
$neutron_l2gw_extensions = $l2gw ? {