From 09fe020035e8acdab02d22a23216c4dab9ce51f8 Mon Sep 17 00:00:00 2001
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Thu, 16 Jan 2020 11:15:07 +0100
Subject: odl-ovs noha: Support VLAN tagged public

Some baremetal servers might have VLAN tagged public interfaces
configured via PDF/IDF, adjust our compute networking j2 handling to
accomodate that.

Change-Id: I97c07f9742a09cd01e7aecf118ada270a682280e
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
(cherry picked from commit 1a8c8c147a0ac647ea19794eb40ed5fb8eedf819)
---
 .../classes/cluster/mcp-odl-noha/openstack/compute.yml.j2   | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2 b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2
index fe8e47649..44ebb86b1 100644
--- a/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2
+++ b/mcp/reclass/classes/cluster/mcp-odl-noha/openstack/compute.yml.j2
@@ -49,11 +49,14 @@ parameters:
           netmask: ${_param:opnfv_net_private_mask}
         {{ nm.cmp001.nic_private }}:
           type: dpdk  # Not a meaningful type, just match 'dpdk' for filtering
-        {{ nm.cmp001.nic_public }}:
-          enabled: true
-          type: eth
-          mtu: ${_param:interface_mtu}
-          proto: manual
+
+{%- set nics = { nm.cmp001.nic_public: True } %}
+{%- set vlans = { nm.vlan_public: nm.cmp001.nic_public } %}
+
+{{ ma.linux_network_interfaces_nic(nics) }}
+
+{{ ma.linux_network_interfaces_vlan(vlans) }}
+
         br-floating:
           enabled: true
           type: ovs_bridge
-- 
cgit