From f75f429ef4ba63986c47e542f71c62943b33a106 Mon Sep 17 00:00:00 2001
From: Bob Fournier <bfournie@redhat.com>
Date: Thu, 11 Jan 2018 17:04:38 -0500
Subject: [PATCH] Set cloud_name hiera parameter for composable networks

This sets the cloud_name hiera parameter using jinja for all
networks including any custom networks.

It also cleans up hiera parameters for virtual ips that are no
longer being used due to https://review.openstack.org/#/c/531037/.
The internal_api_virtual_ip parameter must be kept because its
used for contrail.

Change-Id: I876263d374804e9f032f511112baa5fa7e67b49b
Closes-Bug: 1740953
---
 puppet/all-nodes-config.j2.yaml | 18 +++++-------------
 1 file changed, 5 insertions(+), 13 deletions(-)

diff --git a/puppet/all-nodes-config.j2.yaml b/puppet/all-nodes-config.j2.yaml
index 7098a67cb1..9b01dc40e2 100644
--- a/puppet/all-nodes-config.j2.yaml
+++ b/puppet/all-nodes-config.j2.yaml
@@ -183,11 +183,8 @@ resources:
                   get_param: [NetVipMap, {get_param: [ServiceNetMap, keystone_public_api_network]}]
                 public_virtual_ip: {get_param: [NetVipMap, {get_param: ExternalNetName}]}
                 controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
-{%- for network in networks if network.vip|default(false) %}
-                # TODO - remove these when puppet-tripleo patch https://review.openstack.org/#/c/531037 merges
-                # the internal_api_virtual_ip will still be needed for now however, as its used by contrail
-                {{network.name_lower}}_virtual_ip: {get_param: [NetVipMap, {get_param: {{network.name}}NetName}]}
-{%- endfor %}
+                # the internal_api_virtual_ip is needed for contrail only
+                internal_api_virtual_ip: {get_param: [NetVipMap, {get_param: InternalApiNetName}]}
                 network_virtual_ips:
 {% set count = 1 %}
 {%- for network in networks if network.vip|default(false) %}
@@ -205,16 +202,11 @@ resources:
                 tripleo::haproxy::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
                 tripleo::keepalived::public_virtual_ip: {get_param: [NetVipMap, {get_param: ExternalNetName}]}
                 tripleo::keepalived::controller_virtual_ip: {get_param: [NetVipMap, ctlplane]}
-                # TODO - remove virtual_ips when puppet-tripleo patch https://review.openstack.org/#/c/531037 merges
-                tripleo::keepalived::internal_api_virtual_ip: {get_param: [NetVipMap, {get_param: InternalApiNetName}]}
-                tripleo::keepalived::storage_virtual_ip: {get_param: [NetVipMap, {get_param: StorageNetName}]}
-                tripleo::keepalived::storage_mgmt_virtual_ip: {get_param: [NetVipMap, {get_param: StorageMgmtNetName}]}
                 tripleo::keepalived::redis_virtual_ip: {get_param: RedisVirtualIP}
                 tripleo::redis_notification::haproxy_monitor_ip: {get_param: [NetVipMap, ctlplane]}
-                cloud_name_external: {get_param: cloud_name_external}
-                cloud_name_internal_api: {get_param: cloud_name_internal_api}
-                cloud_name_storage: {get_param: cloud_name_storage}
-                cloud_name_storage_mgmt: {get_param: cloud_name_storage_mgmt}
+{%- for network in networks if network.vip|default(false) %}
+                cloud_name_{{network.name_lower}}: {get_param: cloud_name_{{network.name_lower}}}
+{%- endfor %}
                 cloud_name_ctlplane: {get_param: cloud_name_ctlplane}
                 # TLS parameters
                 certmonger_ca: {get_param: CertmongerCA}