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
This commit is contained in:
Takashi Kajinami 2023-03-13 13:13:02 +09:00
parent be6f32b62a
commit 266914b5ac
2 changed files with 31 additions and 2 deletions

View File

@ -58,6 +58,7 @@ class { 'openstack_integration::glance':
image_encryption => true, image_encryption => true,
} }
class { 'openstack_integration::neutron': class { 'openstack_integration::neutron':
baremetal_enabled => true,
metering_enabled => true, metering_enabled => true,
} }
include openstack_integration::swift include openstack_integration::swift

View File

@ -22,6 +22,10 @@
# (optional) Flag to enable BGP dragent # (optional) Flag to enable BGP dragent
# Defaults to false. # Defaults to false.
# #
# [*baremetal_enabled*]
# (optional) Flag to enable networking-baremetal
# Defaults to false.
#
# [*notification_topics*] # [*notification_topics*]
# (optional) AMQP topic used for OpenStack notifications # (optional) AMQP topic used for OpenStack notifications
# Defaults to $facts['os_service_default']. # Defaults to $facts['os_service_default'].
@ -32,12 +36,17 @@ class openstack_integration::neutron (
$bgpvpn_enabled = false, $bgpvpn_enabled = false,
$l2gw_enabled = false, $l2gw_enabled = false,
$bgp_dragent_enabled = false, $bgp_dragent_enabled = false,
$baremetal_enabled = false,
$notification_topics = $facts['os_service_default'], $notification_topics = $facts['os_service_default'],
) { ) {
include openstack_integration::config include openstack_integration::config
include openstack_integration::params 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 { if $::openstack_integration::config::ssl {
openstack_integration::ssl_key { 'neutron': openstack_integration::ssl_key { 'neutron':
notify => Service['neutron-server'], notify => Service['neutron-server'],
@ -244,11 +253,15 @@ class openstack_integration::neutron (
'ovn' => 38, 'ovn' => 38,
default => $facts['os_service_default'] default => $facts['os_service_default']
} }
$drivers_real = $baremetal_enabled ? {
true => [$driver, 'baremetal'],
default => [$driver],
}
class { 'neutron::plugins::ml2': class { 'neutron::plugins::ml2':
type_drivers => [$overlay_network_type, 'vlan', 'flat'], type_drivers => [$overlay_network_type, 'vlan', 'flat'],
tenant_network_types => [$overlay_network_type, 'vlan', 'flat'], tenant_network_types => [$overlay_network_type, 'vlan', 'flat'],
extension_drivers => 'port_security,qos', extension_drivers => 'port_security,qos',
mechanism_drivers => $driver, mechanism_drivers => $drivers_real,
max_header_size => $max_header_size, 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': class { 'neutron::server::notifications::nova':
auth_url => $::openstack_integration::config::keystone_admin_uri, auth_url => $::openstack_integration::config::keystone_admin_uri,
password => 'a_big_secret', password => 'a_big_secret',