Debian/Ubuntu: Drop old workaround for broken service status

It seems the issue no longer exists in Debian or Ubuntu, likely since
these distributions replaced init by systemd.

Change-Id: I432917dd991409c434ce5c7fac9fd6458943d266
This commit is contained in:
Takashi Kajinami 2023-10-15 04:06:47 +09:00
parent 29789848df
commit e6d918f616
5 changed files with 42 additions and 66 deletions

View File

@ -171,8 +171,6 @@ class ovn::controller(
service { 'controller':
ensure => true,
name => $::ovn::params::ovn_controller_service_name,
hasstatus => $::ovn::params::ovn_controller_service_status,
pattern => $::ovn::params::ovn_controller_service_pattern,
enable => true,
subscribe => Vs_config['external_ids:ovn-remote']
}

View File

@ -219,12 +219,10 @@ class ovn::northd(
}
service { 'northd':
ensure => true,
enable => true,
name => $::ovn::params::ovn_northd_service_name,
hasstatus => $::ovn::params::ovn_northd_service_status,
pattern => $::ovn::params::ovn_northd_service_pattern,
require => Service['openvswitch']
ensure => true,
enable => true,
name => $::ovn::params::ovn_northd_service_name,
require => Service['openvswitch']
}
package { $::ovn::params::ovn_northd_package_name:

View File

@ -7,32 +7,24 @@ class ovn::params {
include openstacklib::defaults
case $facts['os']['family'] {
'RedHat': {
$ovn_northd_package_name = 'openvswitch-ovn-central'
$ovn_controller_package_name = 'openvswitch-ovn-host'
$ovn_northd_service_name = 'ovn-northd'
$ovn_northd_service_status = true
$ovn_northd_service_pattern = undef
$ovn_northd_context = '/files/etc/sysconfig/ovn-northd'
$ovn_northd_option_name = 'OVN_NORTHD_OPTS'
$ovn_controller_service_name = 'ovn-controller'
$ovn_controller_service_status = true
$ovn_controller_service_pattern = undef
$ovn_controller_context = '/files/etc/sysconfig/ovn-controller'
$ovn_controller_option_name = 'OVN_CONTROLLER_OPTS'
$ovn_northd_package_name = 'openvswitch-ovn-central'
$ovn_controller_package_name = 'openvswitch-ovn-host'
$ovn_northd_service_name = 'ovn-northd'
$ovn_northd_context = '/files/etc/sysconfig/ovn-northd'
$ovn_northd_option_name = 'OVN_NORTHD_OPTS'
$ovn_controller_service_name = 'ovn-controller'
$ovn_controller_context = '/files/etc/sysconfig/ovn-controller'
$ovn_controller_option_name = 'OVN_CONTROLLER_OPTS'
}
'Debian': {
$ovn_northd_package_name = 'ovn-central'
$ovn_controller_package_name = 'ovn-host'
$ovn_northd_service_name = 'ovn-central'
$ovn_northd_service_status = false # status broken in UCA
$ovn_northd_service_pattern = 'ovn-northd'
$ovn_northd_context = '/files/etc/default/ovn-central'
$ovn_northd_option_name = 'OVN_CTL_OPTS'
$ovn_controller_service_name = 'ovn-host'
$ovn_controller_service_status = false # status broken in UCA
$ovn_controller_service_pattern = 'ovn-controller'
$ovn_controller_context = '/files/etc/default/ovn-host'
$ovn_controller_option_name = 'OVN_CTL_OPTS'
$ovn_northd_package_name = 'ovn-central'
$ovn_controller_package_name = 'ovn-host'
$ovn_northd_service_name = 'ovn-central'
$ovn_northd_context = '/files/etc/default/ovn-central'
$ovn_northd_option_name = 'OVN_CTL_OPTS'
$ovn_controller_service_name = 'ovn-host'
$ovn_controller_context = '/files/etc/default/ovn-host'
$ovn_controller_option_name = 'OVN_CTL_OPTS'
}
default: {
fail " Osfamily ${facts['os']['family']} not supported yet"

View File

@ -20,11 +20,9 @@ describe 'ovn::controller' do
it 'starts controller' do
is_expected.to contain_service('controller').with(
:ensure => true,
:name => platform_params[:ovn_controller_service_name],
:enable => true,
:hasstatus => platform_params[:ovn_controller_service_status],
:pattern => platform_params[:ovn_controller_service_pattern],
:ensure => true,
:name => platform_params[:ovn_controller_service_name],
:enable => true,
)
end
@ -269,24 +267,20 @@ describe 'ovn::controller' do
when 'Debian'
let :platform_params do
{
:ovn_controller_package_name => 'ovn-host',
:ovn_controller_service_name => 'ovn-host',
:ovn_controller_service_status => false,
:ovn_controller_service_pattern => 'ovn-controller',
:ovn_controller_context => '/files/etc/default/ovn-host',
:ovn_controller_option_name => 'OVN_CTL_OPTS'
:ovn_controller_package_name => 'ovn-host',
:ovn_controller_service_name => 'ovn-host',
:ovn_controller_context => '/files/etc/default/ovn-host',
:ovn_controller_option_name => 'OVN_CTL_OPTS'
}
end
it_behaves_like 'ovn controller'
when 'RedHat'
let :platform_params do
{
:ovn_controller_package_name => 'openvswitch-ovn-host',
:ovn_controller_service_name => 'ovn-controller',
:ovn_controller_service_status => true,
:ovn_controller_service_pattern => nil,
:ovn_controller_context => '/files/etc/sysconfig/ovn-controller',
:ovn_controller_option_name => 'OVN_CONTROLLER_OPTS'
:ovn_controller_package_name => 'openvswitch-ovn-host',
:ovn_controller_service_name => 'ovn-controller',
:ovn_controller_context => '/files/etc/sysconfig/ovn-controller',
:ovn_controller_option_name => 'OVN_CONTROLLER_OPTS'
}
end
it_behaves_like 'ovn controller'

View File

@ -230,11 +230,9 @@ describe 'ovn::northd' do
it 'starts northd' do
is_expected.to contain_service('northd').with(
:ensure => true,
:name => platform_params[:ovn_northd_service_name],
:enable => true,
:hasstatus => platform_params[:ovn_northd_service_status],
:pattern => platform_params[:ovn_northd_service_pattern],
:ensure => true,
:name => platform_params[:ovn_northd_service_name],
:enable => true,
)
end
@ -259,12 +257,10 @@ describe 'ovn::northd' do
when 'Debian'
let(:platform_params) do
{
:ovn_northd_package_name => 'ovn-central',
:ovn_northd_service_name => 'ovn-central',
:ovn_northd_service_status => false,
:ovn_northd_service_pattern => 'ovn-northd',
:ovn_northd_context => '/files/etc/default/ovn-central',
:ovn_northd_option_name => 'OVN_CTL_OPTS'
:ovn_northd_package_name => 'ovn-central',
:ovn_northd_service_name => 'ovn-central',
:ovn_northd_context => '/files/etc/default/ovn-central',
:ovn_northd_option_name => 'OVN_CTL_OPTS'
}
end
it_behaves_like 'ovn northd'
@ -272,12 +268,10 @@ describe 'ovn::northd' do
when 'RedHat'
let(:platform_params) do
{
:ovn_northd_package_name => 'openvswitch-ovn-central',
:ovn_northd_service_name => 'ovn-northd',
:ovn_northd_service_status => true,
:ovn_northd_service_pattern => nil,
:ovn_northd_context => '/files/etc/sysconfig/ovn-northd',
:ovn_northd_option_name => 'OVN_NORTHD_OPTS'
:ovn_northd_package_name => 'openvswitch-ovn-central',
:ovn_northd_service_name => 'ovn-northd',
:ovn_northd_context => '/files/etc/sysconfig/ovn-northd',
:ovn_northd_option_name => 'OVN_NORTHD_OPTS'
}
end
it_behaves_like 'ovn northd'