fix vs_port interface_type

if setting interface_type equal 'internal' requires
a different ovs-vsctl call to create the port.

Closes-Bug: #1771134
Change-Id: Ib56b424b85a1be5ab34fc1e3255c017081509f0d
This commit is contained in:
Benedikt Trefzer committed 2025-04-20 17:01:25 +02:00
1 parent 18b3704248
commit 081e9be22b
3 files changed
+12 -1

No files matched your search

+5 -1
View File
@@ -25,7 +25,11 @@ Puppet::Type.type(:vs_port).provide(
end
# create with first interface, other interfaces will be added later when synchronizing properties
vsctl('--', '--id=@iface0', 'create', 'Interface', "name=#{@resource[:interface][0]}", '--', 'add-port', @resource[:bridge], @resource[:port], 'interfaces=@iface0')
if @resource[:interface_type] == :internal
vsctl('add-port', @resource[:bridge], @resource[:port], '--', 'set', 'Interface', @resource[:port], 'type=internal')
else
vsctl('--', '--id=@iface0', 'create', 'Interface', "name=#{@resource[:interface][0]}", '--', 'add-port', @resource[:bridge], @resource[:port], 'interfaces=@iface0')
end
# synchronize properties
# Only sync those properties actually supported by the provider. This
+2
View File
@@ -4,6 +4,8 @@ Puppet::Type.newtype(:vs_port) do
desc 'A Virtual Switch Port'
feature :bonding, "The provider supports bonded interfaces"
feature :interface_type, "The provider supports interface types"
feature :vlan, "The provider supports vlans"
ensurable
@@ -0,0 +1,5 @@
---
fixes:
- |
vs_port setting interface_type to 'internal' is fixed.
see: https://bugs.launchpad.net/puppet-vswitch/+bug/1771134