From 19913423a73f5913f7aa12a0737b2d2d36639efe Mon Sep 17 00:00:00 2001
From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Date: Sun, 21 Jan 2018 18:28:03 +0100
Subject: [baremetal] Fix cmp proto dhcp on PXE/admin

Although we properly filter the PXE/admin interface in the common
openstack_compute_pdf.yml.j2 template and use DHCP instead of manual
setup, we failed to do the same in scenario-specific overrides
(ODL, OVS), so we end up with 'proto: manual' on PXE/admin on cmp
nodes.

The fix is trivial and reuses the mechanism in the common class in
scenario-specific templates (if interface is PXE/admin, use 'DHCP'
instead of 'manual').

This solves the issue of broken connectivity to Salt master after
cmp reboot.

Change-Id: I1953d03343190acb2efcab4412a3d37e130b0ea9
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
---
 .../cluster/baremetal-mcp-pike-odl-ha/openstack/compute_pdf.yml.j2    | 4 ++++
 .../cluster/baremetal-mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2    | 4 ++++
 2 files changed, 8 insertions(+)

(limited to 'mcp')

diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-odl-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/baremetal-mcp-pike-odl-ha/openstack/compute_pdf.yml.j2
index 7809bd8c8..d5a424431 100644
--- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-odl-ha/openstack/compute_pdf.yml.j2
+++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-odl-ha/openstack/compute_pdf.yml.j2
@@ -53,7 +53,11 @@ parameters:
         {{ nic }}:
           enabled: true
           type: eth
+    {%- if nic == nic_admin %}
+          proto: dhcp
+    {%- else %}
           proto: manual
+    {%- endif %}
           name: {{ nic }}
 {%- endfor %}
 
diff --git a/mcp/reclass/classes/cluster/baremetal-mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2 b/mcp/reclass/classes/cluster/baremetal-mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2
index 7acb4b4c6..18ee09064 100644
--- a/mcp/reclass/classes/cluster/baremetal-mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2
+++ b/mcp/reclass/classes/cluster/baremetal-mcp-pike-ovs-ha/openstack/compute_pdf.yml.j2
@@ -53,7 +53,11 @@ parameters:
         {{ nic }}:
           enabled: true
           type: eth
+    {%- if nic == nic_admin %}
+          proto: dhcp
+    {%- else %}
           proto: manual
+    {%- endif %}
           name: {{ nic }}
 {%- endfor %}
 
-- 
cgit