From 3bc3a8828c3ceefedd08e1767ae6e3bf2df9ac22 Mon Sep 17 00:00:00 2001 From: Harry Huang Date: Wed, 23 Aug 2017 15:05:02 +0800 Subject: Support multiple physnet mapping JIRA: COMPASS-559 1. support multiple mapping in provider_net_mappings of network.yml and create corresponding ovs bridges 2. support seperate config in sys_intf_mappings of network.yml 3. remove linux bridges in compute nodes for ovs port binding convenience 4. support openstack vlan tenant network 5. modify odl and odl_sfc roles to use configurable provider mapping 6. remove some hard coding Change-Id: Ib57484ce60d029f89c647fd5baf2c7af37c85d0b Signed-off-by: Harry Huang --- .../vars/HA-ansible-multinodes.tmpl | 59 +++++++++++++++++----- 1 file changed, 45 insertions(+), 14 deletions(-) (limited to 'deploy/compass_conf/templates') diff --git a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl index 704c23fb..527f480a 100755 --- a/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl +++ b/deploy/compass_conf/templates/ansible_installer/openstack_ocata/vars/HA-ansible-multinodes.tmpl @@ -3,13 +3,18 @@ #set network_cfg = $getVar('network_cfg', {}) #set ntp_server = $getVar('ntp_server', "") #set ceph_disk = $getVar('ceph_disk',"") -#set $sys_intf_mappings= {} -#for $intf_info in $network_cfg.sys_intf_mappings -#set $sys_intf_mappings[$intf_info["name"]] = $intf_info -#end for - #set controllers = $getVar('controller', []) #set computes = $getVar('compute', []) +#set $contr_sys_mappings= {} +#set $compu_sys_mappings= {} +#for $intf_info in $network_cfg.sys_intf_mappings +#if "controller" in $intf_info["role"] +#set $contr_sys_mappings[$intf_info["name"]] = $intf_info +#end if +#if "compute" in $intf_info["role"] +#set $compu_sys_mappings[$intf_info["name"]] = $intf_info +#end if +#end for #set ip_settings={} #for k,v in $getVar('ip_settings', {}).items() @@ -35,6 +40,18 @@ #end if #end for +#set provider_net_mappings = $network_cfg["provider_net_mappings"] +#set contr_prv_mappings = {} +#set compu_prv_mappings = {} +#for item in $provider_net_mappings +#if "controller" in $item["role"] +#set $contr_prv_mappings[$item["network"]] = {"bridge":$item["name"],"interface":$item["interface"]} +#end if +#if "compute" in $item["role"] +#set $compu_prv_mappings[$item["network"]] = {"bridge":$item["name"],"interface":$item["interface"]} +#end if +#end for + #set neutron_cfg = $getVar('neutron_config', {}) #set ovs_config = $neutron_cfg.openvswitch #set has = $getVar('ha', []) @@ -51,7 +68,15 @@ onos_nic: $getVar('onos_nic', 'eth2') onos_sfc: $getVar('onos_sfc', 'Disable') ip_settings: $ip_settings network_cfg: $network_cfg -sys_intf_mappings: $sys_intf_mappings + +provider_net_mappings: $network_cfg["provider_net_mappings"] + +contr_sys_mappings: $contr_sys_mappings +compu_sys_mappings: $compu_sys_mappings + +contr_prv_mappings: $contr_prv_mappings +compu_prv_mappings: $compu_prv_mappings + deploy_type: $getVar('deploy_type', 'virtual') mgmt_cidr: $mgmt_cfg["cidr"] @@ -59,6 +84,7 @@ external_cidr: $external_cfg["cidr"] tenant_cidr: $tenant_cfg["cidr"] storage_cidr: $storage_cfg["cidr"] +tenant_net_info: "{{ network_cfg.tenant_net_info }}" public_net_info: "{{ network_cfg.public_net_info }}" host_ip_settings: "{{ ip_settings[inventory_hostname] }}" @@ -71,19 +97,19 @@ offline_repo_port: $getVar('offline_repo_port', '5151') internal_vip: ip: $network_cfg["internal_vip"]["ip"] netmask: $network_cfg["internal_vip"]["netmask"] -#if "vlan_tag" in $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]] - interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["name"] +#if "vlan_tag" in $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]] + interface: $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]]["name"] #else - interface: $sys_intf_mappings[$network_cfg["internal_vip"]["interface"]]["interface"] + interface: $contr_sys_mappings[$network_cfg["internal_vip"]["interface"]]["interface"] #end if public_vip: ip: $network_cfg["public_vip"]["ip"] netmask: $network_cfg["public_vip"]["netmask"] -#if "vlan_tag" in $sys_intf_mappings[$network_cfg["public_vip"]["interface"]] - interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["name"] +#if "vlan_tag" in $contr_sys_mappings[$network_cfg["public_vip"]["interface"]] + interface: $contr_sys_mappings[$network_cfg["public_vip"]["interface"]]["name"] #else - interface: $sys_intf_mappings[$network_cfg["public_vip"]["interface"]]["interface"] + interface: $contr_sys_mappings[$network_cfg["public_vip"]["interface"]]["interface"] #end if db_host: "{{ internal_vip.ip }}" @@ -182,12 +208,17 @@ CONGRESS_PASS: $congress_pass DEMO_PASS: $demo_pass ADMIN_PASS: $admin_pass -#set neutron_service_plugins=['router'] +#set plugins = $getVar('plugins', []) +#for item in plugins +#set keys = $item.keys() +#set values = $item.values() +$keys[0]: $values[0] +#end for +#set neutron_service_plugins=['router'] #if $getVar('enable_fwaas', True) #neutron_service_plugins.append('firewall') #end if - #if $getVar('enable_vpnaas', True) #neutron_service_plugins.append('vpnaas') #end if -- cgit 1.2.3-korg