From ef1768e40c3a6c58a22381a4546772f571bee5cc Mon Sep 17 00:00:00 2001
From: Steven Hardy <shardy@redhat.com>
Date: Mon, 2 Oct 2017 18:09:21 +0100
Subject: [PATCH] Fix some missed hard-coded network references

These got missed in the refactoring to support composable networks.

Change-Id: I5c97df08ae84e9c383175687428fb00143d171ff
Closes-Bug: #1720849
---
 network/service_net_map.j2.yaml               | 38 ++++---------------
 ...s-config.yaml => all-nodes-config.j2.yaml} | 38 ++++---------------
 2 files changed, 16 insertions(+), 60 deletions(-)
 rename puppet/{all-nodes-config.yaml => all-nodes-config.j2.yaml} (92%)

diff --git a/network/service_net_map.j2.yaml b/network/service_net_map.j2.yaml
index 54646c38c3..414eaf9344 100644
--- a/network/service_net_map.j2.yaml
+++ b/network/service_net_map.j2.yaml
@@ -104,31 +104,12 @@ parameters:
                  internal use only, this will be removed in future.
     type: json
 
-  InternalApiNetName:
-    default: internal_api
-    description: The name of the internal_api network.
+{%- for network in networks %}
+  {{network.name}}NetName:
+    default: {{network.name_lower}}
+    description: The name of the {{network.name_lower}} network.
     type: string
-  ExternalNetName:
-    default: external
-    description: The name of the external network.
-    type: string
-  ManagementNetName:
-    default: management
-    description: The name of the management network.
-    type: string
-  StorageNetName:
-    default: storage
-    description: The name of the storage network.
-    type: string
-  StorageMgmtNetName:
-    default: storage_mgmt
-    description: The name of the storage_mgmt network.
-    type: string
-  TenantNetName:
-    default: tenant
-    description: The name of the tenant network.
-    type: string
-
+{%- endfor %}
 
 parameter_groups:
 - label: deprecated
@@ -146,12 +127,9 @@ resources:
           - map_replace:
              - {get_param: ServiceNetMapDefaults}
              - values:
-                 external: {get_param: ExternalNetName}
-                 internal_api: {get_param: InternalApiNetName}
-                 storage: {get_param: StorageNetName}
-                 storage_mgmt: {get_param: StorageMgmtNetName}
-                 tenant: {get_param: TenantNetName}
-                 management: {get_param: ManagementNetName}
+{%- for network in networks %}
+                 {{network.name_lower}}: {get_param: {{network.name}}NetName}
+{%- endfor %}
           - map_replace:
              - {get_param: ServiceNetMap}
              - keys: {get_param: ServiceNetMapDeprecatedMapping}
diff --git a/puppet/all-nodes-config.yaml b/puppet/all-nodes-config.j2.yaml
similarity index 92%
rename from puppet/all-nodes-config.yaml
rename to puppet/all-nodes-config.j2.yaml
index 37c1d4e52e..bdd2bcf3f8 100644
--- a/puppet/all-nodes-config.yaml
+++ b/puppet/all-nodes-config.j2.yaml
@@ -2,14 +2,10 @@ heat_template_version: pike
 description: 'All Nodes Config for Puppet'
 
 parameters:
-  cloud_name_external:
-    type: string
-  cloud_name_internal_api:
-    type: string
-  cloud_name_storage:
-    type: string
-  cloud_name_storage_mgmt:
+{%- for network in networks if network.vip|default(false) %}
+  cloud_name_{{network.name_lower}}:
     type: string
+{%- endfor %}
   cloud_name_ctlplane:
     type: string
   enabled_services:
@@ -70,30 +66,12 @@ parameters:
     type: boolean
     default: false
 
-  InternalApiNetName:
-    default: internal_api
-    description: The name of the internal_api network.
-    type: string
-  ExternalNetName:
-    default: external
-    description: The name of the external network.
-    type: string
-  ManagementNetName:
-    default: management
-    description: The name of the management network.
-    type: string
-  StorageNetName:
-    default: storage
-    description: The name of the storage network.
-    type: string
-  StorageMgmtNetName:
-    default: storage_mgmt
-    description: The name of the storage_mgmt network.
-    type: string
-  TenantNetName:
-    default: tenant
-    description: The name of the tenant network.
+{%- for network in networks %}
+  {{network.name}}NetName:
+    default: {{network.name_lower}}
+    description: The name of the {{network.name_lower}} network.
     type: string
+{%- endfor %}
 
 
 resources: