1 From c08ad0a7c950cf35a3f178fe8b84beb227bfe5ca Mon Sep 17 00:00:00 2001
2 From: Jackie Huang <jackie.huang@windriver.com>
3 Date: Fri, 13 Nov 2020 17:45:42 +0800
4 Subject: [PATCH] poky-stx.rb: add vlan support for poky-stx
6 Upstream-Status: Inappropriate [poky-stx specific]
8 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
10 lib/puppet/provider/network_config/poky-stx.rb | 10 +++++++++-
11 1 file changed, 9 insertions(+), 1 deletion(-)
13 diff --git a/lib/puppet/provider/network_config/poky-stx.rb b/lib/puppet/provider/network_config/poky-stx.rb
14 index 17fa34c..9b0506a 100644
15 --- a/lib/puppet/provider/network_config/poky-stx.rb
16 +++ b/lib/puppet/provider/network_config/poky-stx.rb
17 @@ -45,7 +45,7 @@ Puppet::Type.type(:network_config).provide(:pokystx) do
19 # These fields are going to get rearranged to resolve issue 16
20 # https://github.com/adrienthebo/puppet-network/issues/16
21 - attr_accessor :ipaddress, :netmask, :family, :method, :mtu
22 + attr_accessor :ipaddress, :netmask, :family, :method, :mtu, :mode
26 @@ -66,6 +66,7 @@ Puppet::Type.type(:network_config).provide(:pokystx) do
31 :options => squeeze_options
34 @@ -185,6 +186,7 @@ Puppet::Type.type(:network_config).provide(:pokystx) do
35 #Instance[name].name = name
36 Instance[name].family = family
37 Instance[name].method = method
38 + Instance[name].mode = :raw
41 # If we match on a string with a leading iface, but it isn't in the
42 @@ -219,6 +221,7 @@ Puppet::Type.type(:network_config).provide(:pokystx) do
43 when 'address'; Instance[name].ipaddress = val
44 when 'netmask'; Instance[name].netmask = val
45 when 'mtu'; Instance[name].mtu = val
46 + when 'vlan-raw-device'; Instance[name].mode = :vlan
47 else Instance[name].options[key] << val
50 @@ -260,6 +263,11 @@ Puppet::Type.type(:network_config).provide(:pokystx) do
51 stanza << %{iface #{provider.name} #{provider.family} #{provider.method}}
54 + if provider.options['VLAN'] and provider.options['VLAN'] == 'yes'
55 + raw_device = provider.options['PHYSDEV']
56 + stanza << " vlan-raw-device #{raw_device}"
60 [:ipaddress, 'address'],
61 [:netmask, 'netmask'],