Merge "Deploy versionless keystone endpoints (for keystone only)"
[apex-tripleo-heat-templates.git] / overcloud.j2.yaml
index 5b2ca4a..e99f770 100644 (file)
@@ -243,6 +243,12 @@ resources:
       NetIpMap: {get_attr: [VipMap, net_ip_map]}
       ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
 
+  EndpointMapData:
+    type: OS::Heat::Value
+    properties:
+      type: json
+      value: {get_attr: [EndpointMap, endpoint_map]}
+
   # Jinja loop for Role in roles_data.yaml
 {% for role in roles %}
   # Resources generated for {{role.name}} Role
@@ -255,6 +261,18 @@ resources:
       EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
       DefaultPasswords: {get_attr: [DefaultPasswords, passwords]}
 
+  # Filter any null/None service_names which may be present due to mapping
+  # of services to OS::Heat::None
+  {{role.name}}ServiceNames:
+    type: OS::Heat::Value
+    depends_on: {{role.name}}ServiceChain
+    properties:
+      type: comma_delimited_list
+      value:
+        yaql:
+          expression: coalesce($.data, []).where($ != null)
+          data: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+
   {{role.name}}HostsDeployment:
     type: OS::Heat::StructuredDeployments
     properties:
@@ -305,7 +323,7 @@ resources:
       StorageMgmtIpList: {get_attr: [{{role.name}}, storage_mgmt_ip_address]}
       TenantIpList: {get_attr: [{{role.name}}, tenant_ip_address]}
       ManagementIpList: {get_attr: [{{role.name}}, management_ip_address]}
-      EnabledServices: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+      EnabledServices: {get_attr: [{{role.name}}ServiceNames, value]}
       ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
       ServiceHostnameList: {get_attr: [{{role.name}}, hostname]}
       NetworkHostnameMap:
@@ -361,8 +379,8 @@ resources:
                         {% for r in roles %}
                           - get_attr: [{{r.name}}ServiceChain, role_data, service_config_settings]
                         {% endfor %}
-                    services: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
-          ServiceNames: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+                    services: {get_attr: [{{role.name}}ServiceNames, value]}
+          ServiceNames: {get_attr: [{{role.name}}ServiceNames, value]}
           MonitoringSubscriptions: {get_attr: [{{role.name}}ServiceChain, role_data, monitoring_subscriptions]}
           ServiceMetadataSettings: {get_attr: [{{role.name}}ServiceChain, role_data, service_metadata_settings]}
 {% endfor %}
@@ -396,7 +414,7 @@ resources:
         list_join:
           - ','
 {% for role in roles %}
-          - {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+          - {get_attr: [{{role.name}}ServiceNames, value]}
 {% endfor %}
       logging_groups:
         yaql:
@@ -622,7 +640,7 @@ outputs:
     value: true
   KeystoneURL:
     description: URL for the Overcloud Keystone service
-    value: {get_attr: [EndpointMap, endpoint_map, KeystonePublic, uri]}
+    value: {get_attr: [EndpointMapData, value, KeystonePublic, uri]}
   KeystoneAdminVip:
     description: Keystone Admin VIP endpoint
     value: {get_attr: [VipMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, KeystoneAdminApiNetwork]}]}
@@ -631,7 +649,7 @@ outputs:
       Mapping of the resources with the needed info for their endpoints.
       This includes the protocol used, the IP, port and also a full
       representation of the URI.
-    value: {get_attr: [EndpointMap, endpoint_map]}
+    value: {get_attr: [EndpointMapData, value]}
   HostsEntry:
     description: |
       The content that should be appended to your /etc/hosts if you want to get
@@ -646,7 +664,7 @@ outputs:
     description: The services enabled on each role
     value:
 {% for role in roles %}
-      {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+      {{role.name}}: {get_attr: [{{role.name}}ServiceNames, value]}
 {% endfor %}
   RoleData:
     description: The configuration data associated with each role