aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml
diff options
context:
space:
mode:
authorHarry Huang <huangxiangyu5@huawei.com>2017-08-23 15:05:02 +0800
committerHarry Huang <huangxiangyu5@huawei.com>2017-09-01 16:31:01 +0800
commit3bc3a8828c3ceefedd08e1767ae6e3bf2df9ac22 (patch)
tree7413e99b2d9ddbadc782a5e9f68a6f1ba35570b1 /plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml
parent292985dab007c3ee1c3481c985871a3483d9f7bc (diff)
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 <huangxiangyu5@huawei.com>
Diffstat (limited to 'plugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml')
-rwxr-xr-xplugins/odl_sfc/roles/setup-odl-sfc/tasks/odl-pre.yml46
1 files changed, 46 insertions, 0 deletions
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) }}"