Do not use service resource to restart openvswitch service
Conflicts: manifests/dpdk.pp Backport note: This was initially implemented to fix the regression caused by [1], however it turned out the same issue is triggered by the dependency implemented in puppet-ovn, so I'm backporting this to stable/wallaby as well. [1]96dd49f1ae
Closes-Bug: #1946985 Change-Id: Idac29b0ea6794a52ae9146da8105ebbaf65ee9a3 (cherry picked from commit1fe71cf5e3
) (cherry picked from commitf5ee885fff
)
This commit is contained in:
parent
6d0b3d586e
commit
ee7c31bf5f
|
@ -31,6 +31,21 @@ Puppet::Type.newtype(:vs_config) do
|
||||||
defaultto :true
|
defaultto :true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
newparam(:restart) do
|
||||||
|
desc 'Should the openvswitch service be restarted'
|
||||||
|
|
||||||
|
newvalues(:true, :false)
|
||||||
|
defaultto :false
|
||||||
|
end
|
||||||
|
|
||||||
|
autorequire(:service) do
|
||||||
|
['openvswitch']
|
||||||
|
end
|
||||||
|
|
||||||
|
autonotify(:service) do
|
||||||
|
['restart openvswitch'] if self[:restart]
|
||||||
|
end
|
||||||
|
|
||||||
newproperty(:value) do
|
newproperty(:value) do
|
||||||
desc 'Configuration value for the parameter'
|
desc 'Configuration value for the parameter'
|
||||||
|
|
||||||
|
|
|
@ -112,7 +112,7 @@ class vswitch::dpdk (
|
||||||
if $enable_hw_offload {
|
if $enable_hw_offload {
|
||||||
vs_config { 'other_config:hw-offload':
|
vs_config { 'other_config:hw-offload':
|
||||||
value => 'true',
|
value => 'true',
|
||||||
notify => Service['openvswitch'],
|
restart => true,
|
||||||
wait => true,
|
wait => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -146,5 +146,13 @@ class vswitch::dpdk (
|
||||||
name => $::vswitch::params::ovs_service_name,
|
name => $::vswitch::params::ovs_service_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# NOTE(tkajinam): This resource is defined to restart the openvswitch services
|
||||||
|
# when any vs_config resource with restart => true is enabled.
|
||||||
|
exec { 'restart openvswitch':
|
||||||
|
path => ['/sbin', '/usr/sbin', '/bin', '/usr/bin'],
|
||||||
|
command => "systemctl -q restart ${::vswitch::params::ovs_service_name}.service",
|
||||||
|
refreshonly => true,
|
||||||
|
}
|
||||||
|
|
||||||
create_resources('vs_config', $dpdk_configs, $dpdk_dependencies)
|
create_resources('vs_config', $dpdk_configs, $dpdk_dependencies)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ class vswitch::ovs(
|
||||||
if $enable_hw_offload {
|
if $enable_hw_offload {
|
||||||
vs_config { 'other_config:hw-offload':
|
vs_config { 'other_config:hw-offload':
|
||||||
value => 'true',
|
value => 'true',
|
||||||
notify => Service['openvswitch'],
|
restart => true,
|
||||||
wait => true,
|
wait => true,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,6 +127,14 @@ class vswitch::ovs(
|
||||||
Service['ovsdb-server'] ~> Service['openvswitch']
|
Service['ovsdb-server'] ~> Service['openvswitch']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# NOTE(tkajinam): This resource is defined to restart the openvswitch service
|
||||||
|
# when any vs_config resource with restart => true is enabled.
|
||||||
|
exec { 'restart openvswitch':
|
||||||
|
path => ['/sbin', '/usr/sbin', '/bin', '/usr/bin'],
|
||||||
|
command => "systemctl -q restart ${::vswitch::params::ovs_service_name}.service",
|
||||||
|
refreshonly => true,
|
||||||
|
}
|
||||||
|
|
||||||
package { $::vswitch::params::ovs_package_name:
|
package { $::vswitch::params::ovs_package_name:
|
||||||
ensure => $package_ensure,
|
ensure => $package_ensure,
|
||||||
before => Service['openvswitch'],
|
before => Service['openvswitch'],
|
||||||
|
|
|
@ -80,7 +80,7 @@ describe 'vswitch::dpdk' do
|
||||||
:value => '-n 2', :wait => false,
|
:value => '-n 2', :wait => false,
|
||||||
)
|
)
|
||||||
is_expected.to contain_vs_config('other_config:hw-offload').with(
|
is_expected.to contain_vs_config('other_config:hw-offload').with(
|
||||||
:value => 'true', :notify => 'Service[openvswitch]', :wait => true,
|
:value => 'true', :restart => true, :wait => true,
|
||||||
)
|
)
|
||||||
is_expected.to contain_vs_config('other_config:emc-insert-inv-prob').with(
|
is_expected.to contain_vs_config('other_config:emc-insert-inv-prob').with(
|
||||||
:value => '0', :wait => false,
|
:value => '0', :wait => false,
|
||||||
|
|
|
@ -96,7 +96,7 @@ describe 'vswitch::ovs' do
|
||||||
end
|
end
|
||||||
it 'configures hw-offload option' do
|
it 'configures hw-offload option' do
|
||||||
is_expected.to contain_vs_config('other_config:hw-offload').with(
|
is_expected.to contain_vs_config('other_config:hw-offload').with(
|
||||||
:value => 'true', :notify => 'Service[openvswitch]', :wait => true,
|
:value => 'true', :restart => true, :wait => true,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
it 'configures disable_emc option' do
|
it 'configures disable_emc option' do
|
||||||
|
|
Loading…
Reference in New Issue