Merge "Add Octavia OVN Provider configuration (2 of 2)"

This commit is contained in:
Zuul 2020-04-10 15:24:46 +00:00 committed by Gerrit Code Review
commit e27d092742
3 changed files with 16 additions and 25 deletions

View File

@ -48,15 +48,15 @@
# for more details. # for more details.
# Defaults to hiera('step') # Defaults to hiera('step')
# #
# DEPRECATED PARAMETERS
#
# [*ovn_db_host*] # [*ovn_db_host*]
# (Optional) The IP-Address where OVN DBs are listening. # (Optional) The IP-Address where OVN DBs are listening.
# Defaults to hiera('ovn_dbs_vip') # Defaults to undef
# #
# [*ovn_nb_port*] # [*ovn_nb_port*]
# (Optional) Port number on which northbound database is listening # (Optional) Port number on which northbound database is listening
# Defaults to hiera('ovn::northbound::port') # Defaults to undef
#
# DEPRECATED PARAMETERS
# #
# [*neutron_driver*] # [*neutron_driver*]
# (Optional) The neutron driver for ml2 currently default tripleo value is ovn. # (Optional) The neutron driver for ml2 currently default tripleo value is ovn.
@ -70,8 +70,8 @@ class tripleo::profile::base::octavia::api (
$octavia_network = hiera('octavia_api_network', undef), $octavia_network = hiera('octavia_api_network', undef),
$step = Integer(hiera('step')), $step = Integer(hiera('step')),
$neutron_driver = hiera('neutron::plugins::ml2::mechanism_drivers', []), $neutron_driver = hiera('neutron::plugins::ml2::mechanism_drivers', []),
$ovn_db_host = hiera('ovn_dbs_vip', undef), $ovn_db_host = undef,
$ovn_nb_port = hiera('ovn::northbound::port', undef), $ovn_nb_port = undef,
) { ) {
if $bootstrap_node and $::hostname == downcase($bootstrap_node) { if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
$sync_db = true $sync_db = true
@ -99,12 +99,12 @@ class tripleo::profile::base::octavia::api (
# before it starts on other nodes # before it starts on other nodes
if ($step >= 4 and $sync_db) or ($step >= 5 and !$sync_db) { if ($step >= 4 and $sync_db) or ($step >= 5 and !$sync_db) {
include octavia::controller include octavia::controller
if $ovn_db_host and $ovn_nb_port { if $ovn_db_host or $ovn_nb_port {
$ovn_nb_connection = join(['tcp', normalize_ip_for_uri($ovn_db_host), "${ovn_nb_port}"], ':') warning('The ovn_db_host and ovn_nb_port parameters are deprecated from tripleo::profile::base::octavia::api. \
Use tripleo::profile::base::octavia::provider::ovn.')
} }
class { 'octavia::api': class { 'octavia::api':
sync_db => $sync_db, sync_db => $sync_db,
ovn_nb_connection => $ovn_nb_connection,
} }
include tripleo::profile::base::apache include tripleo::profile::base::apache
class { 'octavia::wsgi::apache': class { 'octavia::wsgi::apache':

View File

@ -0,0 +1,7 @@
---
deprecations:
- |
ovn_db_host and ovn_nb_port from tripleo::profile::base::octavia::api
are now deprecated and will be removed in the future release. Please use
ovn_db_host and ovn_nb_port from tripleo::profile::base::octavia::provider::ovn
instead.

View File

@ -102,22 +102,6 @@ eos
end end
end end
context 'with step 4 with ovn' do
before do
params.merge!({
:step => 4,
:bootstrap_node => 'node.example.com',
:neutron_driver => ['ovn'],
:ovn_db_host => '127.0.0.1',
:ovn_nb_port => '6641'
})
end
it 'should should set provider drivers and ovn nb connection' do
is_expected.to contain_class('octavia::api').with(:ovn_nb_connection => 'tcp:127.0.0.1:6641')
end
end
context 'with step 4 on non-bootstrap node' do context 'with step 4 on non-bootstrap node' do
before do before do
params.merge!({ :step => 4 }) params.merge!({ :step => 4 })