From 266914b5ac6fb5e771520a2fba9e9cb2957ad374 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Mon, 13 Mar 2023 13:13:02 +0900 Subject: [PATCH] Deploy networking-baremetal when ironic is enabled The networking-baremetal mechanism driver is often used to connect baremetal nodes managed by ironic to neutron networks. This ensures the component can be deployed by the module feature. Change-Id: I667dd881b59cb1bd2874db50412b7ec908e0aba2 --- fixtures/scenario002.pp | 3 ++- manifests/neutron.pp | 30 +++++++++++++++++++++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/fixtures/scenario002.pp b/fixtures/scenario002.pp index e9bfd2608..55e11c195 100644 --- a/fixtures/scenario002.pp +++ b/fixtures/scenario002.pp @@ -58,7 +58,8 @@ class { 'openstack_integration::glance': image_encryption => true, } class { 'openstack_integration::neutron': - metering_enabled => true, + baremetal_enabled => true, + metering_enabled => true, } include openstack_integration::swift include openstack_integration::ironic diff --git a/manifests/neutron.pp b/manifests/neutron.pp index 584b2845d..f17816386 100644 --- a/manifests/neutron.pp +++ b/manifests/neutron.pp @@ -22,6 +22,10 @@ # (optional) Flag to enable BGP dragent # Defaults to false. # +# [*baremetal_enabled*] +# (optional) Flag to enable networking-baremetal +# Defaults to false. +# # [*notification_topics*] # (optional) AMQP topic used for OpenStack notifications # Defaults to $facts['os_service_default']. @@ -32,12 +36,17 @@ class openstack_integration::neutron ( $bgpvpn_enabled = false, $l2gw_enabled = false, $bgp_dragent_enabled = false, + $baremetal_enabled = false, $notification_topics = $facts['os_service_default'], ) { include openstack_integration::config include openstack_integration::params + if $driver == 'ovn' and $metering_enabled { + fail('Metering agent is not supported when ovn mechanism driver is used.') + } + if $::openstack_integration::config::ssl { openstack_integration::ssl_key { 'neutron': notify => Service['neutron-server'], @@ -244,11 +253,15 @@ class openstack_integration::neutron ( 'ovn' => 38, default => $facts['os_service_default'] } + $drivers_real = $baremetal_enabled ? { + true => [$driver, 'baremetal'], + default => [$driver], + } class { 'neutron::plugins::ml2': type_drivers => [$overlay_network_type, 'vlan', 'flat'], tenant_network_types => [$overlay_network_type, 'vlan', 'flat'], extension_drivers => 'port_security,qos', - mechanism_drivers => $driver, + mechanism_drivers => $drivers_real, max_header_size => $max_header_size, } @@ -328,6 +341,21 @@ class openstack_integration::neutron ( } } } + + if $baremetal_enabled { + class { 'neutron::plugins::ml2::networking_baremetal': } + class { 'neutron::agents::ml2::networking_baremetal': + auth_url => $::openstack_integration::config::keystone_admin_uri, + password => 'a_big_secret', + } + class { 'neutron::server::notifications::ironic': + auth_url => $::openstack_integration::config::keystone_admin_uri, + password => 'a_big_secret', + } + + Anchor['ironic::service::end'] -> Service['ironic-neutron-agent-service'] + } + class { 'neutron::server::notifications::nova': auth_url => $::openstack_integration::config::keystone_admin_uri, password => 'a_big_secret',