add multiple uplinks support
The network and uplink mapping now should be set in the new format: a) Multiple strings each for one cluster in a textarea item; b) Uplinks-mapping is optional c) possible data is: 1. Cluster:VDS 2. Cluster:VDS:TU1;TU2;TU3 3. Cluster:VDS:TU1;TU2:FU3;FU4 where TU -- teaming uplink, FU -- fallback uplink, there is no limitation for amount of uplinks, uplinks shoud be splitted by ';' Change-Id: Ibf40675bb048a15a70157598931fae211da04edb
This commit is contained in:
parent
364894a955
commit
bd01b39922
|
@ -7,7 +7,7 @@
|
|||
raise(Puppet::ParseError, 'Shoud have 5 arguments!') if args.size < 4 or args[0] == ""
|
||||
vcenter = args[0]['computes']
|
||||
physnet = args[1]["predefined_networks"]["admin_internal_net"]["L2"]["physnet"]
|
||||
netmaps = args[2]["vmware_dvs_net_maps"].delete(' ')
|
||||
netmaps = args[2]["vmware_dvs_net_maps"].delete(' ').split("\n")
|
||||
use_fw_driver = args[2]["vmware_dvs_fw_driver"]
|
||||
current_node = args[3].split(".")[0]
|
||||
controllersp = args[4].any? {|role| role.include?("controller")}
|
||||
|
@ -23,12 +23,21 @@
|
|||
agent["vsphere_insecure"] = vc["vc_insecure"]
|
||||
agent["vsphere_ca_file"] = vc["vc_ca_file"]
|
||||
cluster = vc["vc_cluster"]
|
||||
if netmaps.include? ':'
|
||||
vds = netmaps.split(";").collect{|k| k.split(":")}.select{|x| x[0] == cluster}.collect{|x| x[1]}[0]
|
||||
netmaps = netmaps.keep_if {|s| s =~ /^#{cluster}/}.first.split(":")
|
||||
if netmaps.length == 4
|
||||
vds = netmaps[1]
|
||||
uplinks = netmaps[2] + ":" + netmaps[3]
|
||||
elsif netmaps.length == 3
|
||||
vds = netmaps[1]
|
||||
uplinks = netmaps[2]
|
||||
elsif netmaps.length == 2
|
||||
vds = netmaps[1]
|
||||
uplinks = false
|
||||
else
|
||||
vds = netmaps
|
||||
raise 'Wrong vmware_dvs_net_maps'
|
||||
end
|
||||
agent["network_maps"] = physnet + ":" + vds
|
||||
agent["uplink_maps"] = physnet + ":" + uplinks if uplinks
|
||||
agent["use_fw_driver"] = use_fw_driver
|
||||
agent["ha_enabled"] = controllersp
|
||||
agent["primary"] = primaryp
|
||||
|
|
|
@ -45,6 +45,10 @@
|
|||
# (required) String. This is a name of DVS.
|
||||
# Defaults to 'physnet1:dvSwitch1'.
|
||||
#
|
||||
# [*uplink_maps*]
|
||||
# (required) String. This is a string that explains uplinks usage policy.
|
||||
# Defaults to undef.
|
||||
#
|
||||
# [*use_fw_driver*]
|
||||
# (optional) Boolean. Use firewall driver or mock.
|
||||
# Defaults to true.
|
||||
|
@ -69,6 +73,7 @@ define vmware_dvs::agent(
|
|||
$vsphere_insecure = true,
|
||||
$vsphere_ca_file = undef,
|
||||
$network_maps = 'physnet1:dvSwitch1',
|
||||
$uplink_maps = undef,
|
||||
$use_fw_driver = true,
|
||||
$py_root = '/usr/lib/python2.7/dist-packages',
|
||||
$ha_enabled = true,
|
||||
|
|
|
@ -7,9 +7,12 @@ firewall_driver=<%= @fw_driver %>
|
|||
|
||||
[ml2_vmware]
|
||||
vsphere_login=<%= @vsphere_login %>
|
||||
network_maps=<%= @network_maps %>
|
||||
vsphere_hostname=<%= @vsphere_hostname %>
|
||||
vsphere_password=<%= @vsphere_password %>
|
||||
network_maps=<%= @network_maps %>
|
||||
<% if @uplink_maps -%>
|
||||
uplink_maps=<%= @uplink_maps%>
|
||||
<% end -%>
|
||||
insecure=<%= @agent_vcenter_insecure_real %>
|
||||
<% if @agent_vcenter_ca_filepath and @agent_vcenter_ca_filepath \
|
||||
!= "<SERVICE DEFAULT>" and !@agent_vcenter_ca_filepath.empty? -%>
|
||||
|
|
|
@ -15,9 +15,9 @@ attributes:
|
|||
vmware_dvs_net_maps:
|
||||
value: ""
|
||||
label: "Enter the Cluster to dvSwitch mapping."
|
||||
description: "List of ClusterName:dvSwitchName pairs, separated by semicolon."
|
||||
description: "List of strings with format ClusterName:dvSwitchName:TeamingUplink1;TeamingUplink2:FallbackUplink1;FallbackUplink2."
|
||||
weight: 25
|
||||
type: "text"
|
||||
type: "textarea"
|
||||
regex:
|
||||
source: &non_empty_string '\S'
|
||||
error: "Empty name of dvSwitch"
|
||||
|
|
Loading…
Reference in New Issue