Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Add OVN to enabled provider drivers in Octavia
Browse files Browse the repository at this point in the history
Add OVN driver to Octavia provider driver,
when OVN is in neutron mechanism driver

Change-Id: I578360029d044255fa85b0fdf29ea1ea0e7a47e4
  • Loading branch information
mrkisaolamb committed Feb 21, 2019
1 parent e43c67e commit 97c46ca
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
16 changes: 14 additions & 2 deletions manifests/profile/base/octavia/api.pp
Expand Up @@ -63,6 +63,10 @@
# enable_internal_tls is set.
# defaults to 9876
#
# [*neutron_driver*]
# (Optional) The neutron driver for ml2 currently default tripleo value is ovn.
# Defaults to hiera('neutron::plugins::ml2::mechanism_drivers')
#
class tripleo::profile::base::octavia::api (
$bootstrap_node = hiera('octavia_api_short_bootstrap_node_name', undef),
$certificates_specs = hiera('apache_certificates_specs', {}),
Expand All @@ -72,6 +76,7 @@
$tls_proxy_bind_ip = undef,
$tls_proxy_fqdn = undef,
$tls_proxy_port = 9876,
$neutron_driver = hiera('neutron::plugins::ml2::mechanism_drivers', []),
) {
if $::hostname == downcase($bootstrap_node) {
$sync_db = true
Expand Down Expand Up @@ -111,8 +116,15 @@
# before it starts on other nodes
if ($step >= 4 and $sync_db) or ($step >= 5 and !$sync_db) {
include ::octavia::controller
class { '::octavia::api':
sync_db => $sync_db,
if 'ovn' in $neutron_driver {
class { '::octavia::api':
sync_db => $sync_db,
provider_drivers => { 'amphora' => 'Octavia Amphora Driver', 'ovn' => 'Octavia OVN driver' },
}
} else {
class { '::octavia::api':
sync_db => $sync_db,
}
}
}
}
14 changes: 14 additions & 0 deletions spec/classes/tripleo_profile_base_octavia_api_spec.rb
Expand Up @@ -105,6 +105,20 @@ class { 'octavia::keystone::authtoken':
end
end

context 'with step 4 with ovn' do
before do
params.merge!({
:step => 4,
:bootstrap_node => 'node.example.com',
:neutron_driver => ['ovn']
})
end

it 'should should set provider drivers' do
is_expected.to contain_class('octavia::api').with(:provider_drivers => { 'amphora' => 'Octavia Amphora Driver', 'ovn' => 'Octavia OVN driver' })
end
end

context 'with step 4 on non-bootstrap node' do
before do
params.merge!({ :step => 4 })
Expand Down

0 comments on commit 97c46ca

Please sign in to comment.