Skip to content

Commit

Permalink
Update vswitch to a36332da0ddb9d419e1d3f9d170058284b144f06
Browse files Browse the repository at this point in the history
a36332da0ddb9d419e1d3f9d170058284b144f06 Merge "Release 1.0.0 - Juno"
b3fdd245a59b36fbc943bed481ac26c6f987845a Release 1.0.0 - Juno
fab186f37b8729401913f765ce22d401a2ef3485 Fixed issue with vlan on redhat provider
  • Loading branch information
xbezdick committed Dec 2, 2014
1 parent 79fd6c3 commit 744df2e
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Puppetfile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ mod 'vlan',
:git => 'https://github.com/derekhiggins/puppet-vlan.git'

mod 'vswitch',
:commit => '51fd30c22b79d927fb0329e6e2b58fe67217ecee',
:commit => 'a36332da0ddb9d419e1d3f9d170058284b144f06',
:git => 'https://github.com/stackforge/puppet-vswitch.git'

mod 'xinetd',
Expand Down
6 changes: 5 additions & 1 deletion vswitch/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# puppet-vswitch
VSwitch
=======

1.0.0 - 2014.2.0 - Juno

A Puppet module providing things for vSwitches. At the moment OVS is the only
one I've added but please feel free to contribute new providers through
Stackforge. It's based upon types and providers so we can support more then just
Expand Down
14 changes: 14 additions & 0 deletions vswitch/lib/puppet/provider/vs_port/ovs_redhat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def create
end

port = IFCFG::Port.new(@resource[:interface], @resource[:bridge])
if vlan?
port.set('VLAN' => 'yes')
end
port.save(BASE + @resource[:interface])

bridge = IFCFG::Bridge.new(@resource[:bridge], template)
Expand Down Expand Up @@ -115,6 +118,17 @@ def from_str(data)
items.merge!(m[1] => m[2])
end
end
items.delete('VLAN') if items.has_key?('VLAN')
items
end

def vlan?
if File.read('/proc/net/vlan/config') =~ /#{@resource[:interface]}/
return true
else
return false
end
rescue Errno::ENOENT
return false
end
end

0 comments on commit 744df2e

Please sign in to comment.