Merge "Rename parameter 'tag' to 'vlan_tag' in l23network module"
This commit is contained in:
commit
5184552a8e
@ -256,14 +256,14 @@ In example above we create two ports with tags 10 and 20, and assign IP address
|
|||||||
bridge => 'bridge0',
|
bridge => 'bridge0',
|
||||||
type => 'internal',
|
type => 'internal',
|
||||||
port_properties => [
|
port_properties => [
|
||||||
'tag=10'
|
'vlan_id=10'
|
||||||
],
|
],
|
||||||
} ->
|
} ->
|
||||||
l23network::l2::port{'vl20':
|
l23network::l2::port{'vl20':
|
||||||
bridge => 'bridge0',
|
bridge => 'bridge0',
|
||||||
type => 'internal',
|
type => 'internal',
|
||||||
port_properties => [
|
port_properties => [
|
||||||
'tag=20'
|
'vlan_id=20'
|
||||||
],
|
],
|
||||||
} ->
|
} ->
|
||||||
l23network::l3::ifconfig {'vl10':
|
l23network::l3::ifconfig {'vl10':
|
||||||
|
@ -34,7 +34,7 @@ module L23network
|
|||||||
:name => nil,
|
:name => nil,
|
||||||
:bridge => nil,
|
:bridge => nil,
|
||||||
#:type => "internal",
|
#:type => "internal",
|
||||||
:tag => 0,
|
:vlan_id => 0,
|
||||||
:trunks => [],
|
:trunks => [],
|
||||||
:port_properties => [],
|
:port_properties => [],
|
||||||
:interface_properties => [],
|
:interface_properties => [],
|
||||||
@ -45,7 +45,7 @@ module L23network
|
|||||||
:provider => 'ovs',
|
:provider => 'ovs',
|
||||||
:bridge => nil,
|
:bridge => nil,
|
||||||
:interfaces => [],
|
:interfaces => [],
|
||||||
:tag => 0,
|
:vlan_id => 0,
|
||||||
:trunks => [],
|
:trunks => [],
|
||||||
:properties => [],
|
:properties => [],
|
||||||
#:port_properties => [],
|
#:port_properties => [],
|
||||||
@ -56,7 +56,7 @@ module L23network
|
|||||||
:name => "unnamed", # calculated later
|
:name => "unnamed", # calculated later
|
||||||
:peers => [nil, nil],
|
:peers => [nil, nil],
|
||||||
:bridges => [],
|
:bridges => [],
|
||||||
:tags => [0, 0],
|
:vlan_ids => [0, 0],
|
||||||
:trunks => [],
|
:trunks => [],
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -28,8 +28,8 @@ Puppet::Type.type(:l2_ovs_bond).provide(:ovs) do
|
|||||||
end
|
end
|
||||||
|
|
||||||
bond_properties = Array(@resource[:properties])
|
bond_properties = Array(@resource[:properties])
|
||||||
if @resource[:tag] > 0
|
if @resource[:vlan_id] > 0
|
||||||
bond_properties.insert(-1, "tag=#{@resource[:tag]}")
|
bond_properties.insert(-1, "tag=#{@resource[:vlan_id]}")
|
||||||
end
|
end
|
||||||
if not @resource[:trunks].empty?
|
if not @resource[:trunks].empty?
|
||||||
bond_properties.insert(-1, "trunks=[#{@resource[:trunks].join(',')}]")
|
bond_properties.insert(-1, "trunks=[#{@resource[:trunks].join(',')}]")
|
||||||
|
@ -46,7 +46,7 @@ Puppet::Type.type(:l2_ovs_patch).provide(:ovs) do
|
|||||||
for name in names
|
for name in names
|
||||||
# tag and trunks for port
|
# tag and trunks for port
|
||||||
port_properties = [] #@resource[:port_properties]
|
port_properties = [] #@resource[:port_properties]
|
||||||
tag = @resource[:tags][i]
|
tag = @resource[:vlan_ids][i]
|
||||||
if tag > 0
|
if tag > 0
|
||||||
port_properties.insert(-1, "tag=#{tag}")
|
port_properties.insert(-1, "tag=#{tag}")
|
||||||
end
|
end
|
||||||
|
@ -18,8 +18,8 @@ Puppet::Type.type(:l2_ovs_port).provide(:ovs) do
|
|||||||
end
|
end
|
||||||
# tag and trunks for port
|
# tag and trunks for port
|
||||||
port_properties = @resource[:port_properties]
|
port_properties = @resource[:port_properties]
|
||||||
if @resource[:tag] > 0
|
if @resource[:vlan_id] > 0
|
||||||
port_properties.insert(-1, "tag=#{@resource[:tag]}")
|
port_properties.insert(-1, "tag=#{@resource[:vlan_id]}")
|
||||||
end
|
end
|
||||||
if not @resource[:trunks].empty?
|
if not @resource[:trunks].empty?
|
||||||
port_properties.insert(-1, "trunks=[#{@resource[:trunks].join(',')}]")
|
port_properties.insert(-1, "trunks=[#{@resource[:trunks].join(',')}]")
|
||||||
|
@ -53,7 +53,7 @@ Puppet::Type.newtype(:l2_ovs_bond) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
newparam(:tag) do
|
newparam(:vlan_id) do
|
||||||
defaultto(0)
|
defaultto(0)
|
||||||
desc "802.1q tag"
|
desc "802.1q tag"
|
||||||
validate do |val|
|
validate do |val|
|
||||||
|
@ -42,7 +42,7 @@ Puppet::Type.newtype(:l2_ovs_patch) do
|
|||||||
# desc "Allow to skip existing bond"
|
# desc "Allow to skip existing bond"
|
||||||
# end
|
# end
|
||||||
|
|
||||||
newparam(:tags, :array_matching => :all) do
|
newparam(:vlan_ids, :array_matching => :all) do
|
||||||
defaultto([0,0])
|
defaultto([0,0])
|
||||||
desc "Array of 802.1q tag for ends."
|
desc "Array of 802.1q tag for ends."
|
||||||
#
|
#
|
||||||
|
@ -52,7 +52,7 @@ Puppet::Type.newtype(:l2_ovs_port) do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
newparam(:tag) do
|
newparam(:vlan_id) do
|
||||||
defaultto(0)
|
defaultto(0)
|
||||||
desc "802.1q tag"
|
desc "802.1q tag"
|
||||||
validate do |val|
|
validate do |val|
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
# [*interfaces*]
|
# [*interfaces*]
|
||||||
# List of interfaces in this bond.
|
# List of interfaces in this bond.
|
||||||
#
|
#
|
||||||
# [*tag*]
|
# [*vlan_id*]
|
||||||
# Specify 802.1q tag for result bond. If need.
|
# Specify 802.1q tag for result bond. If need.
|
||||||
#
|
#
|
||||||
# [*trunks*]
|
# [*trunks*]
|
||||||
@ -30,7 +30,7 @@ define l23network::l2::bond (
|
|||||||
$ports = undef, # deprecated, must be used interfaces
|
$ports = undef, # deprecated, must be used interfaces
|
||||||
$bond = $name,
|
$bond = $name,
|
||||||
$properties = [],
|
$properties = [],
|
||||||
$tag = 0,
|
$vlan_id = 0,
|
||||||
$trunks = [],
|
$trunks = [],
|
||||||
$provider = 'ovs',
|
$provider = 'ovs',
|
||||||
$ensure = present,
|
$ensure = present,
|
||||||
@ -53,7 +53,7 @@ define l23network::l2::bond (
|
|||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
interfaces => $r_interfaces,
|
interfaces => $r_interfaces,
|
||||||
bridge => $bridge,
|
bridge => $bridge,
|
||||||
tag => $tag,
|
vlan_id => $vlan_id,
|
||||||
trunks => $trunks,
|
trunks => $trunks,
|
||||||
properties => $properties,
|
properties => $properties,
|
||||||
skip_existing => $skip_existing,
|
skip_existing => $skip_existing,
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
# [*peers*]
|
# [*peers*]
|
||||||
# Patch port names for both bridges. must be array of two strings.
|
# Patch port names for both bridges. must be array of two strings.
|
||||||
#
|
#
|
||||||
# [*tags*]
|
# [*vlan_ids*]
|
||||||
# Specify 802.1q tag for each end of patchcord. Must be array of 2 integers.
|
# Specify 802.1q tag for each end of patchcord. Must be array of 2 integers.
|
||||||
# Default [0,0] -- untagged
|
# Default [0,0] -- untagged
|
||||||
#
|
#
|
||||||
@ -25,7 +25,7 @@
|
|||||||
define l23network::l2::patch (
|
define l23network::l2::patch (
|
||||||
$bridges,
|
$bridges,
|
||||||
$peers = [undef,undef],
|
$peers = [undef,undef],
|
||||||
$tags = [0, 0],
|
$vlan_ids = [0, 0],
|
||||||
$trunks = [],
|
$trunks = [],
|
||||||
$provider = 'ovs',
|
$provider = 'ovs',
|
||||||
$ensure = present,
|
$ensure = present,
|
||||||
@ -37,14 +37,14 @@ define l23network::l2::patch (
|
|||||||
|
|
||||||
# Architecture limitation.
|
# Architecture limitation.
|
||||||
# We can't create more one patch between same bridges.
|
# We can't create more one patch between same bridges.
|
||||||
#$patch = "${bridges[0]}_${tags[0]}--${bridges[1]}_${tags[1]}"
|
#$patch = "${bridges[0]}_${vlan_ids[0]}--${bridges[1]}_${vlan_ids[1]}"
|
||||||
$patch = "${bridges[0]}--${bridges[1]}"
|
$patch = "${bridges[0]}--${bridges[1]}"
|
||||||
|
|
||||||
if ! defined (L2_ovs_patch["$patch"]) {
|
if ! defined (L2_ovs_patch["$patch"]) {
|
||||||
l2_ovs_patch { "$patch" :
|
l2_ovs_patch { "$patch" :
|
||||||
bridges => $bridges,
|
bridges => $bridges,
|
||||||
peers => $peers,
|
peers => $peers,
|
||||||
tags => $tags,
|
vlan_ids => $vlan_ids,
|
||||||
trunks => $trunks,
|
trunks => $trunks,
|
||||||
ensure => $ensure
|
ensure => $ensure
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
# the port with default behavior.
|
# the port with default behavior.
|
||||||
# (see http://openvswitch.org/cgi-bin/ovsman.cgi?page=utilities%2Fovs-vsctl.8)
|
# (see http://openvswitch.org/cgi-bin/ovsman.cgi?page=utilities%2Fovs-vsctl.8)
|
||||||
#
|
#
|
||||||
# [*tag*]
|
# [*vlan_id*]
|
||||||
# Specify 802.1q tag for result bond. If need.
|
# Specify 802.1q tag for result bond. If need.
|
||||||
#
|
#
|
||||||
# [*trunks*]
|
# [*trunks*]
|
||||||
@ -34,7 +34,7 @@ define l23network::l2::port (
|
|||||||
$type = '',
|
$type = '',
|
||||||
$port_properties = [],
|
$port_properties = [],
|
||||||
$interface_properties = [],
|
$interface_properties = [],
|
||||||
$tag = 0,
|
$vlan_id = 0,
|
||||||
$trunks = [],
|
$trunks = [],
|
||||||
$vlan_splinters = false,
|
$vlan_splinters = false,
|
||||||
$provider = 'ovs',
|
$provider = 'ovs',
|
||||||
@ -50,7 +50,7 @@ define l23network::l2::port (
|
|||||||
ensure => $ensure,
|
ensure => $ensure,
|
||||||
bridge => $bridge,
|
bridge => $bridge,
|
||||||
type => $type,
|
type => $type,
|
||||||
tag => $tag,
|
vlan_id => $vlan_id,
|
||||||
trunks => $trunks,
|
trunks => $trunks,
|
||||||
vlan_splinters => $vlan_splinters,
|
vlan_splinters => $vlan_splinters,
|
||||||
port_properties => $port_properties,
|
port_properties => $port_properties,
|
||||||
|
Loading…
Reference in New Issue
Block a user