diff --git a/deployment_scripts/puppet/modules/contrail/templates/testbed.py.erb b/deployment_scripts/puppet/modules/contrail/templates/testbed.py.erb index 932b7c468..e91d3a358 100644 --- a/deployment_scripts/puppet/modules/contrail/templates/testbed.py.erb +++ b/deployment_scripts/puppet/modules/contrail/templates/testbed.py.erb @@ -67,7 +67,7 @@ c_ctrl_<%= i+1 %> : '<%= ip %>', #External routers ext_routers = [ <%- -gateways=scope.lookupvar('contrail::settings')['contrail_gateways'].split(',') +gateways=scope.lookupvar('contrail::settings')['contrail_gateways'].split(',').map{|x|x.lstrip} gateways.each_with_index do |gw, i| -%> ('gateway<%= i+1 %>','<%= gw %>'), diff --git a/environment_config.yaml b/environment_config.yaml index 5a2645f0f..1189d947e 100644 --- a/environment_config.yaml +++ b/environment_config.yaml @@ -1,4 +1,9 @@ attributes: + # Show contrail only in supported network config + metadata: + restrictions: + - condition: "not (cluster:net_provider == 'neutron' and networking_parameters:segmentation_type == 'vlan')" + message: "Please use Neutron with VLAN segmentation, the only network type supported with Contrail plugin." contrail_asnum: value: '64512' label: 'AS Number' @@ -6,8 +11,8 @@ attributes: weight: 10 type: "text" regex: - source: '\S' - error: "Error field cannot be empty" + source: '^(?:(6553[0-5])|(655[0-2]\d)|(65[0-4]\d{2})|(6[0-4]\d{3})|([1-5]\d{4})|([1-9]\d{1,3})|([1-9]))$' + error: "Invalid AS number" contrail_private_cidr: value: '10.109.3.0/24' label: 'Private network CIDR' @@ -15,8 +20,8 @@ attributes: weight: 20 type: "text" regex: - source: '\S' - error: "Error field cannot be empty" + source: '^(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3}(?:\/(?:[1-2]\d|[8-9]))$' + error: "Invalid network CIDR" contrail_private_start: value: '10.109.3.5' label: 'Private IP range start' @@ -24,8 +29,8 @@ attributes: weight: 30 type: "text" regex: - source: '\S' - error: "Error field cannot be empty" + source: '^(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3}$' + error: "Invalid IP address" contrail_private_end: value: '10.109.3.254' label: 'Private IP range end' @@ -33,8 +38,8 @@ attributes: weight: 40 type: "text" regex: - source: '\S' - error: "Error field cannot be empty" + source: '^(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3}$' + error: "Invalid IP address" contrail_gateways: value: '10.109.3.1,10.109.3.2' label: 'GW IP' @@ -42,8 +47,8 @@ attributes: weight: 50 type: "text" regex: - source: '\S' - error: "Error field cannot be empty" + source: '^(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3}(?:,\s*(?:\d|1?\d\d|2[0-4]\d|25[0-5])(?:\.(?:\d|1?\d\d|2[0-4]\d|25[0-5])){3})*$' + error: "Invalid IP address list" contrail_public_if: value: '' label: 'Public interface' @@ -51,5 +56,5 @@ attributes: weight: 60 type: "text" regex: - source: '\S' - error: "Error field cannot be empty" + source: '^eth((?:\d{1,2})|(?:\d{1,2}\.\d{1,4}))$' + error: "Invalid interface name"