From 241169515643c880ea59e7ad5ac5035d5f428f24 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Tue, 19 Apr 2022 10:20:30 +0900 Subject: [PATCH] dpdk: Create port and bridge after openvswitch service is configured This change ensures that vs_port resources and vs_bridge resources are invoked after the openvswitch service is started, when ovs-dpdk is used instead of normal ovs. Dependency management is refactored to use the autorequire definition of resource types. Change-Id: If2d062823955b9df30d4a980166d7ab0a18f4b5d --- lib/puppet/type/vs_bridge.rb | 4 ++++ lib/puppet/type/vs_port.rb | 4 ++++ manifests/dpdk.pp | 12 ++++-------- manifests/ovs.pp | 4 ---- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lib/puppet/type/vs_bridge.rb b/lib/puppet/type/vs_bridge.rb index cbcce902..4d14f7b1 100644 --- a/lib/puppet/type/vs_bridge.rb +++ b/lib/puppet/type/vs_bridge.rb @@ -27,4 +27,8 @@ Puppet::Type.newtype(:vs_bridge) do end end end + + autorequire(:service) do + ['openvswitch'] + end end diff --git a/lib/puppet/type/vs_port.rb b/lib/puppet/type/vs_port.rb index 26b86460..72b8301a 100644 --- a/lib/puppet/type/vs_port.rb +++ b/lib/puppet/type/vs_port.rb @@ -180,4 +180,8 @@ Puppet::Type.newtype(:vs_port) do autorequire(:vs_bridge) do self[:bridge] if self[:bridge] end + + autorequire(:service) do + ['openvswitch'] + end end diff --git a/manifests/dpdk.pp b/manifests/dpdk.pp index 8fb9d21d..e8de1537 100644 --- a/manifests/dpdk.pp +++ b/manifests/dpdk.pp @@ -117,9 +117,8 @@ class vswitch::dpdk ( } $dpdk_dependencies = { - wait => false, - require => Service['openvswitch'], - notify => Vs_config['other_config:dpdk-init'], + wait => false, + notify => Vs_config['other_config:dpdk-init'], } if $enable_hw_offload { @@ -162,9 +161,8 @@ class vswitch::dpdk ( } vs_config { 'other_config:dpdk-init': - value => true, - require => Service['openvswitch'], - wait => true, + value => true, + wait => true, } service { 'openvswitch': @@ -181,8 +179,6 @@ class vswitch::dpdk ( refreshonly => true, } - Service['openvswitch'] -> Vs_config<||> - create_resources('vs_config', $dpdk_configs, $dpdk_dependencies) create_resources('vs_config', $vs_config) diff --git a/manifests/ovs.pp b/manifests/ovs.pp index 6ced0f0e..fa7f5c59 100644 --- a/manifests/ovs.pp +++ b/manifests/ovs.pp @@ -131,8 +131,4 @@ class vswitch::ovs( before => Service['openvswitch'], tag => 'openvswitch', } - - Service['openvswitch'] -> Vs_port<||> - Service['openvswitch'] -> Vs_bridge<||> - Service['openvswitch'] -> Vs_config<||> }