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 --- .../odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml (limited to 'plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml') diff --git a/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml new file mode 100755 index 00000000..64631663 --- /dev/null +++ b/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml @@ -0,0 +1,46 @@ +--- + +- name: set l2_mapping l3_mapping + copy: + dest: /tmp/odl-extra-vars.yml + content: | + {% set contr_l2_list = [] %} + {% set contr_l3_list = [] %} + {% set pub_l2_mapping = [] %} + {% set pub_l3_mapping = [] %} + {% set pub_intf = [] %} + {% set pub_bridge = [] %} + {% for key, value in contr_prv_mappings.iteritems() %} + {% set l2_mapping = key + ":" + value["bridge"] %} + {% set l3_mapping = key + ":" + value["interface"] %} + {% set _ = contr_l2_list.append(l2_mapping) %} + {% set _ = contr_l3_list.append(l3_mapping) %} + {% if key == public_net_info["provider_network"] %} + {% set _ = pub_l2_mapping.append(l2_mapping) %} + {% set _ = pub_l3_mapping.append(l3_mapping) %} + {% set _ = pub_intf.append(value["interface"]) %} + {% set _ = pub_bridge.append(value["bridge"]) %} + {% endif %} + {% endfor %} + {% set compu_l2_list = [] %} + {% set compu_l3_list = [] %} + {% set compu_pub_intf = compu_sys_mappings["external"]["interface"] %} + {% set compu_pub_vlan = compu_sys_mappings["external"]["vlan_tag"] %} + {% if compu_pub_vlan | int %} + {% set compu_pub_intf = compu_pub_intf + '.' + compu_pub_vlan|string %} + {% endif %} + {% for key, value in compu_prv_mappings.iteritems() %} + {% set l2_mapping = key + ":" + value["bridge"] %} + {% set l3_mapping = key + ":" + value["interface"] %} + {% set _ = compu_l2_list.append(l2_mapping) %} + {% set _ = compu_l3_list.append(l3_mapping) %} + {% endfor %} + {% set pub_l3_mapping = pub_l3_mapping[0].replace(pub_intf[0], compu_pub_intf) %} + {% set _ = compu_l2_list.append(pub_l2_mapping[0]) %} + {% set _ = compu_l3_list.append(pub_l3_mapping) %} + public_bridge: "{{ pub_bridge[0] }}" + contr_public_intf: "{{ pub_intf[0] }}" + contr_l2_mappings: "{{ ','.join(contr_l2_list) }}" + contr_l3_mappings: "{{ ','.join(contr_l3_list) }}" + compu_l2_mappings: "{{ ','.join(compu_l2_list) }}" + compu_l3_mappings: "{{ ','.join(compu_l3_list) }}" -- cgit 1.2.3-korg