diff --git a/fixtures/scenario001.pp b/fixtures/scenario001.pp index 0e8583492..009c1b289 100644 --- a/fixtures/scenario001.pp +++ b/fixtures/scenario001.pp @@ -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': diff --git a/fixtures/scenario002.pp b/fixtures/scenario002.pp index 3aeac97d7..e9bfd2608 100644 --- a/fixtures/scenario002.pp +++ b/fixtures/scenario002.pp @@ -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 diff --git a/manifests/neutron.pp b/manifests/neutron.pp index 74a5c35d9..53c763cc8 100644 --- a/manifests/neutron.pp +++ b/manifests/neutron.pp @@ -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': diff --git a/manifests/tempest.pp b/manifests/tempest.pp index 917e587f8..c955459d4 100644 --- a/manifests/tempest.pp +++ b/manifests/tempest.pp @@ -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 ? {