From 10a24b2faac9d7b9ceb45ba9100625f3937c7a66 Mon Sep 17 00:00:00 2001
From: Steven Hardy <shardy@redhat.com>
Date: Fri, 12 Aug 2016 17:31:58 +0100
Subject: [PATCH] Move ceph cluster config out of allNodesConfig

Pass the list of ceph nodes to the ceph_mon profile via
the service template - this requires some fixup to the
profile to handle the ipv6 case.

Note this also aligns the ServiceNetMap keys so that the
composable node_ips logic will generate the lists when
the ceph_mon service is enabled.

Change-Id: If8a5c65f17e677fe62243b3aa746fd642f72d2b0
Depends-On: I481dd2cd2cde7f1491080e6d9c7dcb7047c22de1
Partially-Implements: blueprint custom-roles
---
 network/service_net_map.yaml   |  3 ++-
 overcloud.yaml                 |  1 -
 puppet/all-nodes-config.yaml   | 14 --------------
 puppet/services/ceph-base.yaml |  8 ++------
 4 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/network/service_net_map.yaml b/network/service_net_map.yaml
index 50f5c55a74..fa63b09c21 100644
--- a/network/service_net_map.yaml
+++ b/network/service_net_map.yaml
@@ -40,7 +40,7 @@ parameters:
       RedisNetwork: internal_api
       MysqlNetwork: internal_api
       CephClusterNetwork: storage_mgmt
-      CephPublicNetwork: storage
+      CephMonNetwork: storage
       ControllerHostnameResolveNetwork: internal_api
       ComputeHostnameResolveNetwork: internal_api
       BlockStorageHostnameResolveNetwork: internal_api
@@ -58,6 +58,7 @@ parameters:
     default:
       MongoDbNetwork: MongodbNetwork
       RabbitMqNetwork: RabbitmqNetwork
+      CephPublicNetwork: CephMonNetwork
     description: Mapping older deprecated service names, intended for
                  internal use only, this will be removed in future.
     type: json
diff --git a/overcloud.yaml b/overcloud.yaml
index e034e8afac..aa67088822 100644
--- a/overcloud.yaml
+++ b/overcloud.yaml
@@ -625,7 +625,6 @@ resources:
       memcache_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, MemcachedNetwork]}]}
       keystone_public_api_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, KeystonePublicApiNetwork]}]}
       keystone_admin_api_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, KeystoneAdminApiNetwork]}]}
-      ceph_mon_node_ips: {get_attr: [ControllerIpListMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, CephPublicNetwork]}]}
       ceph_mon_node_names: {get_attr: [Controller, hostname]}
       DeployIdentifier: {get_param: DeployIdentifier}
       UpdateIdentifier: {get_param: UpdateIdentifier}
diff --git a/puppet/all-nodes-config.yaml b/puppet/all-nodes-config.yaml
index 644c1938c0..a43e96450a 100644
--- a/puppet/all-nodes-config.yaml
+++ b/puppet/all-nodes-config.yaml
@@ -22,8 +22,6 @@ parameters:
     type: comma_delimited_list
   keystone_admin_api_node_ips:
     type: comma_delimited_list
-  ceph_mon_node_ips:
-    type: comma_delimited_list
   ceph_mon_node_names:
     type: comma_delimited_list
   DeployIdentifier:
@@ -126,18 +124,6 @@ resources:
                       list_join:
                       - ','
                       - {get_param: ceph_mon_node_names}
-                    tripleo::profile::base::ceph::ceph_mon_host:
-                      list_join:
-                      - ','
-                      - {get_param: ceph_mon_node_ips}
-                    tripleo::profile::base::ceph::ceph_mon_host_v6:
-                      str_replace:
-                        template: "'[IPS_LIST]'"
-                        params:
-                          IPS_LIST:
-                            list_join:
-                            - '],['
-                            - {get_param: ceph_mon_node_ips}
                     # NOTE(gfidente): interpolation with %{} in the
                     # hieradata file can't be used as it returns string
                     ceilometer::rabbit_hosts: *rabbit_nodes_array
diff --git a/puppet/services/ceph-base.yaml b/puppet/services/ceph-base.yaml
index 4d98546d5a..ce8d91582f 100644
--- a/puppet/services/ceph-base.yaml
+++ b/puppet/services/ceph-base.yaml
@@ -20,9 +20,6 @@ parameters:
   CephClusterFSID:
     type: string
     description: The Ceph cluster FSID. Must be a UUID.
-  CephIPv6:
-    default: False
-    type: boolean
   CinderRbdPoolName:
     default: volumes
     type: string
@@ -72,7 +69,6 @@ outputs:
     value:
       service_name: ceph_base
       config_settings:
-        tripleo::profile::base::ceph::ceph_ipv6: {get_param: CephIPv6}
         tripleo::profile::base::ceph::enable_ceph_storage: {get_param: ControllerEnableCephStorage}
         ceph::profile::params::osd_pool_default_min_size: 1
         ceph::profile::params::osds: {/srv/data: {}}
@@ -93,8 +89,8 @@ outputs:
           str_replace:
             template: "NETWORK_subnet"
             params:
-              NETWORK: {get_param: [ServiceNetMap, CephPublicNetwork]}
-        ceph::profile::params::public_addr: {get_param: [ServiceNetMap, CephPublicNetwork]}
+              NETWORK: {get_param: [ServiceNetMap, CephMonNetwork]}
+        ceph::profile::params::public_addr: {get_param: [ServiceNetMap, CephMonNetwork]}
         ceph::profile::params::client_keys:
           str_replace:
             template: "{