Manage ovn-octavia-provider package

... because the package is independent from the base octavia packages
and should be installed to use the provider.

Change-Id: Ide2941f388f51e35b4faab1cbc383e794fc9523d
This commit is contained in:
Takashi Kajinami 2021-10-05 08:45:30 +09:00
parent a9a19950ab
commit 588ed89e54
4 changed files with 27 additions and 3 deletions

View File

@ -8,6 +8,7 @@ class octavia::params {
$health_manager_service_name = 'octavia-health-manager'
$housekeeping_service_name = 'octavia-housekeeping'
$client_package_name = 'python3-octaviaclient'
$ovn_provider_package_name = 'python3-ovn-octavia-provider'
$group = 'octavia'
case $::osfamily {

View File

@ -2,6 +2,10 @@
#
# == Parameters
#
# [*package_ensure*]
# (optional) ensure state for package.
# Defaults to 'present'
#
# [*ovn_nb_connection*]
# (optional) The connection string for the OVN_Northbound OVSDB.
# Defaults to $::os_service_default
@ -21,13 +25,21 @@
# Defaults to $::os_service_default
#
class octavia::provider::ovn (
$package_ensure = 'present',
$ovn_nb_connection = $::os_service_default,
$ovn_nb_private_key = $::os_service_default,
$ovn_nb_certificate = $::os_service_default,
$ovn_nb_ca_cert = $::os_service_default
) inherits octavia::params {
) {
include octavia::deps
include octavia::params
package { 'ovn-octavia-provider':
ensure => $package_ensure,
name => $::octavia::params::ovn_provider_package_name,
tag => ['openstack', 'octavia-package'],
}
# For backward compatibility
if $::octavia::api::ovn_nb_connection and !is_service_default($::octavia::api::ovn_nb_connection) {

View File

@ -0,0 +1,5 @@
---
features:
- |
Now the ``octavia::provider::ovn`` can manage the package required to use
OVN Octavia provider.

View File

@ -3,8 +3,7 @@ require 'spec_helper'
describe 'octavia::provider::ovn' do
let :params do
{
}
{}
end
shared_examples_for 'octavia-ovn-provider' do
@ -14,6 +13,12 @@ describe 'octavia::provider::ovn' do
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>') }
it { is_expected.to contain_package('ovn-octavia-provider').with(
:ensure => 'present',
:name => 'python3-ovn-octavia-provider',
:tag => ['openstack', 'octavia-package'],
) }
end
context 'with specific parameters' do
@ -40,6 +45,7 @@ describe 'octavia::provider::ovn' do
let (:facts) do
facts.merge!(OSDefaults.get_facts())
end
it_behaves_like 'octavia-ovn-provider'
end
end