Browse Source

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

tags/16.2.0
Zuul 3 months ago
committed by Gerrit Code Review
parent
commit
17c5182534
5 changed files with 25 additions and 15 deletions
  1. +9
    -3
      manifests/api.pp
  2. +4
    -1
      manifests/provider/ovn.pp
  3. +4
    -0
      releasenotes/notes/add-ovn-provider-71b506e3d81e92fe.yaml
  4. +0
    -3
      spec/classes/octavia_api_spec.rb
  5. +8
    -8
      spec/classes/octavia_ovn_provider_spec.rb

+ 9
- 3
manifests/api.pp View File

@@ -63,9 +63,11 @@
# (optional) Configure the loadbalancer provider drivers.
# Defaults to $::os_service_default
#
# DEPRECATED PARAMETERS
#
# [*ovn_nb_connection*]
# (optional) The connection string for the OVN_Northbound OVSDB.
# Defaults to $::os_service_default
# Defaults to undef
#
class octavia::api (
$enabled = true,
@@ -82,7 +84,8 @@ class octavia::api (
$sync_db = false,
$default_provider_driver = $::os_service_default,
$provider_drivers = $::os_service_default,
$ovn_nb_connection = $::os_service_default,
# DEPRECATED PARAMETERS
$ovn_nb_connection = undef
) inherits octavia::params {

include octavia::deps
@@ -93,6 +96,10 @@ class octavia::api (
include octavia::keystone::authtoken
}

if $ovn_nb_connection {
warning('The ovn_nb_connection parameter is deprecated from octavia::api. Use octavia::provider::ovn::ovn_nb_connection.')
}

package { 'octavia-api':
ensure => $package_ensure,
name => $::octavia::params::api_package_name,
@@ -142,6 +149,5 @@ class octavia::api (
'api_settings/allow_tls_terminated_listeners': value => $allow_tls_terminated_listeners;
'api_settings/default_provider_driver': value => $default_provider_driver;
'api_settings/enabled_provider_drivers': value => $provider_drivers;
'ovn/ovn_nb_connection': value => $ovn_nb_connection;
}
}

+ 4
- 1
manifests/provider/ovn.pp View File

@@ -36,7 +36,10 @@ class octavia::provider::ovn (
$ovn_nb_connection_real = $ovn_nb_connection
}

octavia_ovn_provider_config {
# TODO(flaviof): We need to replace octavia_config with octavia_ovn_provider_config in the future.
# For now, the config below uses octavia_config until we can figure out how to pass extra
# configuration files to the api running as wsgi process.
octavia_config {
'ovn/ovn_nb_connection': value => $ovn_nb_connection_real;
'ovn/ovn_nb_private_key': value => $ovn_nb_private_key;
'ovn/ovn_nb_certificate': value => $ovn_nb_certificate;


+ 4
- 0
releasenotes/notes/add-ovn-provider-71b506e3d81e92fe.yaml View File

@@ -2,3 +2,7 @@
features:
- |
Added octavia::provider::ovn for configuring OVN driver properties.
deprecations:
- |
octavia::api::ovn_nb_connection is now deprecated and will be removed in the
future release. Please use octavia::provider::ovn::ovn_nb_connection instead.

+ 0
- 3
spec/classes/octavia_api_spec.rb View File

@@ -13,7 +13,6 @@ describe 'octavia::api' do
:allow_tls_terminated_listeners => false,
:default_provider_driver => 'ovn',
:provider_drivers => { 'amphora' => 'Octavia Amphora Driver', 'ovn' => 'Octavia OVN driver' },
:ovn_nb_connection => 'tcp:127.0.0.1:6641'
}
end

@@ -54,7 +53,6 @@ describe 'octavia::api' do
is_expected.to contain_octavia_config('api_settings/allow_tls_terminated_listeners').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/default_provider_driver').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('api_settings/enabled_provider_drivers').with_value('<SERVICE DEFAULT>')
is_expected.to contain_octavia_config('ovn/ovn_nb_connection').with_value('<SERVICE DEFAULT>')
end
it 'does not sync the database' do
is_expected.not_to contain_class('octavia::db::sync')
@@ -70,7 +68,6 @@ describe 'octavia::api' do
is_expected.to contain_octavia_config('api_settings/allow_tls_terminated_listeners').with_value( params[:allow_tls_terminated_listeners] )
is_expected.to contain_octavia_config('api_settings/default_provider_driver').with_value( params[:default_provider_driver] )
is_expected.to contain_octavia_config('api_settings/enabled_provider_drivers').with_value( params[:provider_drivers] )
is_expected.to contain_octavia_config('ovn/ovn_nb_connection').with_value(params[:ovn_nb_connection])
end

[{:enabled => true}, {:enabled => false}].each do |param_hash|


+ 8
- 8
spec/classes/octavia_ovn_provider_spec.rb View File

@@ -10,10 +10,10 @@ describe 'octavia::provider::ovn' do
shared_examples_for 'octavia-ovn-provider' do

context 'with default parameters' do
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_connection').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_private_key').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_certificate').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_ca_cert').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_connection').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_private_key').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_certificate').with_value('<SERVICE DEFAULT>') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_ca_cert').with_value('<SERVICE DEFAULT>') }
end

context 'with specific parameters' do
@@ -26,10 +26,10 @@ describe 'octavia::provider::ovn' do
})
end

it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_connection').with_value('tcp:127.0.0.1:6641') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_private_key').with_value('/foo.key') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_certificate').with_value('/foo.pem') }
it { is_expected.to contain_octavia_ovn_provider_config('ovn/ovn_nb_ca_cert').with_value('/ca_foo.pem') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_connection').with_value('tcp:127.0.0.1:6641') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_private_key').with_value('/foo.key') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_certificate').with_value('/foo.pem') }
it { is_expected.to contain_octavia_config('ovn/ovn_nb_ca_cert').with_value('/ca_foo.pem') }
end
end



Loading…
Cancel
Save