Add Octavia OVN Provider configuration (2 of 2)

This is part 2 of 2, where ovn provider info located in
tripleo::profile::base::octavia::api will move
to newly created octavia::provider::ovn.
But that has to be split into 2 parts to avoid breaking the
CI until the THT+pupple-tripleo changes merges [1].

[1]: https://review.opendev.org/#/q/topic:bug/1861886+(status:open+OR+status:merged)

This patch enhances Octavia's OVN driver config, so it can connect to
OVN_Northbound DB using TLS.

Depends-On: https://review.opendev.org/#/c/714895/
Depends-On: https://review.opendev.org/#/c/715950/
Depends-On: https://review.opendev.org/#/c/705821/
Depends-On: https://review.opendev.org/#/c/714916/

Closes-Bug: #1861886

Change-Id: If4a6f25015374883050c48b7705e8207906118f4
(cherry picked from commit a485965a23)
This commit is contained in:
Flavio Fernandes 2020-03-18 14:36:15 -04:00
parent b4678ba857
commit b234852533
3 changed files with 16 additions and 25 deletions

View File

@ -48,15 +48,15 @@
# for more details.
# Defaults to hiera('step')
#
# DEPRECATED PARAMETERS
#
# [*ovn_db_host*]
# (Optional) The IP-Address where OVN DBs are listening.
# Defaults to hiera('ovn_dbs_vip')
# Defaults to undef
#
# [*ovn_nb_port*]
# (Optional) Port number on which northbound database is listening
# Defaults to hiera('ovn::northbound::port')
#
# DEPRECATED PARAMETERS
# Defaults to undef
#
# [*neutron_driver*]
# (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),
$step = Integer(hiera('step')),
$neutron_driver = hiera('neutron::plugins::ml2::mechanism_drivers', []),
$ovn_db_host = hiera('ovn_dbs_vip', undef),
$ovn_nb_port = hiera('ovn::northbound::port', undef),
$ovn_db_host = undef,
$ovn_nb_port = undef,
) {
if $::hostname == downcase($bootstrap_node) {
$sync_db = true
@ -99,12 +99,12 @@ class tripleo::profile::base::octavia::api (
# before it starts on other nodes
if ($step >= 4 and $sync_db) or ($step >= 5 and !$sync_db) {
include ::octavia::controller
if $ovn_db_host and $ovn_nb_port {
$ovn_nb_connection = join(['tcp', normalize_ip_for_uri($ovn_db_host), "${ovn_nb_port}"], ':')
if $ovn_db_host or $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':
sync_db => $sync_db,
ovn_nb_connection => $ovn_nb_connection,
}
include ::tripleo::profile::base::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
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
before do
params.merge!({ :step => 4 })