Add support for neutron-ovn-maintenance-worker
Adds support for the new service which was added to neutron to run periodic routines for ML2/OVN driver. Depends-on: https://review.opendev.org/c/openstack/neutron/+/922074 Change-Id: I7a6139b5d744631f70d7c3437c66d6e42431dec9
This commit is contained in:
parent
2e9a3fbcb4
commit
e8ac725925
@ -52,6 +52,8 @@ class neutron::params {
|
||||
$l2gw_package = 'python3-networking-l2gw'
|
||||
$ovn_metadata_agent_package = 'openstack-neutron-ovn-metadata-agent'
|
||||
$ovn_agent_package = 'openstack-neutron-ovn-agent'
|
||||
$ovn_maintenance_worker_package = 'openstack-neutron-ovn-maintenance-worker'
|
||||
$ovn_maintenance_worker_service = 'neutron-ovn-maintenance-worker'
|
||||
$dynamic_routing_package = 'python3-neutron-dynamic-routing'
|
||||
$bgp_dragent_package = 'openstack-neutron-bgp-dragent'
|
||||
$bagpipe_bgp_package = 'openstack-bagpipe-bgp'
|
||||
@ -112,6 +114,8 @@ class neutron::params {
|
||||
$l2gw_package = 'python3-networking-l2gw'
|
||||
$ovn_metadata_agent_package = 'neutron-ovn-metadata-agent'
|
||||
$ovn_agent_package = 'neutron-ovn-agent'
|
||||
$ovn_maintenance_worker_package = undef
|
||||
$ovn_maintenance_worker_service = undef
|
||||
$neutron_wsgi_script_path = '/usr/lib/cgi-bin/neutron'
|
||||
$neutron_wsgi_script_source = '/usr/bin/neutron-api'
|
||||
$networking_baremetal_package = 'python3-ironic-neutron-agent'
|
||||
|
50
manifests/plugins/ml2/ovn/maintenance_worker.pp
Normal file
50
manifests/plugins/ml2/ovn/maintenance_worker.pp
Normal file
@ -0,0 +1,50 @@
|
||||
# == Class: neutron::plugins::ml2::ovn::maintenance_worker
|
||||
#
|
||||
# Setup and configure neutron OVN maintenance worker.
|
||||
#
|
||||
# === Parameters
|
||||
#
|
||||
# [*package_ensure*]
|
||||
# Ensure state of the package. Defaults to 'present'.
|
||||
#
|
||||
# [*enabled*]
|
||||
# State of the service. Defaults to true.
|
||||
#
|
||||
# [*manage_service*]
|
||||
# (optional) Whether to start/stop the service
|
||||
# Defaults to true
|
||||
#
|
||||
class neutron::plugins::ml2::ovn::maintenance_worker (
|
||||
$package_ensure = 'present',
|
||||
Boolean $enabled = true,
|
||||
Boolean $manage_service = true,
|
||||
) {
|
||||
|
||||
include neutron::params
|
||||
|
||||
if $::neutron::params::ovn_maintenance_worker_package {
|
||||
package { 'neutron-ovn-maintenance-worker':
|
||||
ensure => $package_ensure,
|
||||
name => $::neutron::params::ovn_maintenance_worker_package,
|
||||
tag => ['openstack', 'neutron-package'],
|
||||
}
|
||||
}
|
||||
|
||||
if $manage_service {
|
||||
if $::neutron::params::ovn_maintenance_worker_service {
|
||||
if $enabled {
|
||||
$service_ensure = 'running'
|
||||
} else {
|
||||
$service_ensure = 'stopped'
|
||||
}
|
||||
service { 'neutron-ovn-maintenance-worker':
|
||||
ensure => $service_ensure,
|
||||
name => $::neutron::params::ovn_maintenance_worker_service,
|
||||
enable => $enabled,
|
||||
tag => 'neutron-service',
|
||||
}
|
||||
} else {
|
||||
warning('neutron-ovn-maintenance-worker service is not available.')
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
The new ``neutron::plugins::ml2::ovn::maintenance_worker`` class has been
|
||||
added.
|
@ -0,0 +1,59 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'neutron::plugins::ml2::ovn::maintenance_worker' do
|
||||
|
||||
shared_examples 'neutron::plugins::ml2::ovn::maintenance_worker' do
|
||||
it { should contain_class('neutron::params') }
|
||||
|
||||
it 'should install OVN maintenance worker' do
|
||||
should contain_package('neutron-ovn-maintenance-worker').with(
|
||||
:ensure => 'present',
|
||||
:name => platform_params[:ovn_maintenance_worker_package],
|
||||
:tag => ['openstack', 'neutron-package'],
|
||||
)
|
||||
end
|
||||
|
||||
it 'configures OVN maintenance worker' do
|
||||
should contain_service('neutron-ovn-maintenance-worker').with(
|
||||
:name => platform_params[:ovn_maintenance_worker_service],
|
||||
:enable => true,
|
||||
:ensure => 'running',
|
||||
:tag => 'neutron-service',
|
||||
)
|
||||
end
|
||||
|
||||
context 'with manage_service as false' do
|
||||
let :params do
|
||||
{ :manage_service => false }
|
||||
end
|
||||
|
||||
it 'should not manage the service' do
|
||||
should_not contain_service('neutron-ovn-maintenance-worker')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
:supported_os => OSDefaults.get_supported_os
|
||||
}).each do |os,facts|
|
||||
context "on #{os}" do
|
||||
let (:facts) do
|
||||
facts.merge!(OSDefaults.get_facts())
|
||||
end
|
||||
|
||||
let (:platform_params) do
|
||||
case facts[:os]['family']
|
||||
when 'Debian'
|
||||
{}
|
||||
when 'RedHat'
|
||||
{ :ovn_maintenance_worker_package => 'openstack-neutron-ovn-maintenance-worker',
|
||||
:ovn_maintenance_worker_service => 'neutron-ovn-maintenance-worker' }
|
||||
end
|
||||
end
|
||||
|
||||
if facts[:os]['family'] == 'RedHat'
|
||||
it_behaves_like 'neutron::plugins::ml2::ovn::maintenance_worker'
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user