Merge "Only set NovaWorkers in the non-default case"
[apex-tripleo-heat-templates.git] / overcloud.j2.yaml
index ec6f052..db1a78b 100644 (file)
@@ -99,15 +99,8 @@ parameters:
       the overcloud. It's accessible via the Nova metadata API.
     type: json
 
-  # Controller-specific params
-  ControllerCount:
-    type: number
-    default: 1
-
 # Compute-specific params
-  ComputeCount:
-    type: number
-    default: 1
+# FIXME(shardy) handle these deprecated names as they don't match compute.yaml
   HypervisorNeutronPhysicalBridge:
     default: 'br-ex'
     description: >
@@ -122,56 +115,48 @@ parameters:
 
   # Jinja loop for Role in role_data.yaml
 {% for role in roles %}
-  # Resources generated for {{role.name}} Role
+  # Parameters generated for {{role.name}} Role
   {{role.name}}Services:
     description: A list of service resources (configured in the Heat
                  resource_registry) which represent nested stacks
                  for each service that should get installed on the {{role.name}} role.
     type: comma_delimited_list
-  {% if role.ServicesDefault %}
-    default: {{role.ServicesDefault}}
-  {% endif %}
-{% endfor %}
+    default: {{role.ServicesDefault|default([])}}
 
-# Block storage specific parameters
-  BlockStorageCount:
+  {{role.name}}Count:
+    description: Number of {{role.name}} nodes to deploy
     type: number
-    default: 0
+    default: {{role.CountDefault|default(0)}}
 
-# Object storage specific parameters
-  ObjectStorageCount:
-    type: number
-    default: 0
+  {{role.name}}HostnameFormat:
+    type: string
+    description: >
+      Format for {{role.name}} node hostnames
+      Note %index% is translated into the index of the node, e.g 0/1/2 etc
+      and %stackname% is replaced with the stack name e.g overcloud
+  {% if role.HostnameFormatDefault %}
+    default: "{{role.HostnameFormatDefault}}"
+  {% else %}
+    default: "%stackname%-{{role.name.lower()}}-%index%"
+  {% endif %}
 
-# Ceph storage specific parameters
-  CephStorageCount:
-    type: number
-    default: 0
+  {{role.name}}RemovalPolicies:
+    default: []
+    type: json
+    description: >
+      List of resources to be removed from {{role.name}} ResourceGroup when
+      doing an update which requires removal of specific resources.
+      Example format ComputeRemovalPolicies: [{'resource_list': ['0']}]
 
-  # Hostname format for each role
-  # Note %index% is translated into the index of the node, e.g 0/1/2 etc
-  # and %stackname% is replaced with OS::stack_name in the template below.
-  # If you want to use the heat generated names, pass '' (empty string).
-  ControllerHostnameFormat:
-    type: string
-    description: Format for Controller node hostnames
-    default: '%stackname%-controller-%index%'
-  ComputeHostnameFormat:
-    type: string
-    description: Format for Compute node hostnames
-    default: '%stackname%-novacompute-%index%'
-  BlockStorageHostnameFormat:
-    type: string
-    description: Format for BlockStorage node hostnames
-    default: '%stackname%-blockstorage-%index%'
-  ObjectStorageHostnameFormat:
-    type: string
-    description: Format for SwiftStorage node hostnames
-    default: '%stackname%-objectstorage-%index%'
-  CephStorageHostnameFormat:
-    type: string
-    description: Format for CephStorage node hostnames
-    default: '%stackname%-cephstorage-%index%'
+{% if role.name != 'Compute' %}
+  {{role.name}}SchedulerHints:
+{% else %}
+  NovaComputeSchedulerHints:
+{% endif %}
+    type: json
+    description: Optional scheduler hints to pass to nova
+    default: {}
+{% endfor %}
 
   # Identifiers to trigger tasks on nodes
   UpdateIdentifier:
@@ -187,41 +172,6 @@ parameters:
       Setting this to a unique value will re-run any deployment tasks which
       perform configuration on a Heat stack-update.
 
-  # If you want to remove a specific node from a resource group, you can pass
-  # the node name or id as a <Group>RemovalPolicies parameter, for example:
-  # ComputeRemovalPolicies: [{'resource_list': ['0']}]
-  ControllerRemovalPolicies:
-    default: []
-    type: json
-    description: >
-      List of resources to be removed from ControllerResourceGroup when
-      doing an update which requires removal of specific resources.
-  ComputeRemovalPolicies:
-    default: []
-    type: json
-    description: >
-      List of resources to be removed from ComputeResourceGroup when
-      doing an update which requires removal of specific resources.
-  BlockStorageRemovalPolicies:
-    default: []
-    type: json
-    description: >
-      List of resources to be removed from BlockStorageResourceGroup when
-      doing an update which requires removal of specific resources.
-  ObjectStorageRemovalPolicies:
-    default: []
-    type: json
-    description: >
-      List of resources to be removed from ObjectStorageResourceGroup when
-      doing an update which requires removal of specific resources.
-  CephStorageRemovalPolicies:
-    default: []
-    type: json
-    description: >
-      List of resources to be removed from CephStorageResourceGroup when
-      doing an update which requires removal of specific resources.
-
-
 resources:
 
   HeatAuthEncryptionKey:
@@ -282,228 +232,76 @@ resources:
       config: {get_resource: AllNodesValidationConfig}
       servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
 
-{% endfor %}
-
-  Controller:
-    type: OS::Heat::ResourceGroup
-    depends_on: Networks
+  {{role.name}}IpListMap:
+    type: OS::TripleO::Network::Ports::NetIpListMap
     properties:
-      count: {get_param: ControllerCount}
-      removal_policies: {get_param: ControllerRemovalPolicies}
-      resource_def:
-        type: OS::TripleO::Controller
-        properties:
-          CloudDomain: {get_param: CloudDomain}
-          ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
-          EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
-          Hostname:
-            str_replace:
-              template: {get_param: ControllerHostnameFormat}
-              params:
-                '%stackname%': {get_param: 'OS::stack_name'}
-          NodeIndex: '%index%'
-          ServiceConfigSettings:
-            map_merge:
-              - get_attr: [ControllerServiceChain, role_data, config_settings]
-              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
-              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
-              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
-          ServiceNames: {get_attr: [ControllerServiceChain, role_data, service_names]}
-          MonitoringSubscriptions: {get_attr: [ControllerServiceChain, role_data, monitoring_subscriptions]}
-
-  Compute:
+      ControlPlaneIpList: {get_attr: [{{role.name}}, ip_address]}
+      ExternalIpList: {get_attr: [{{role.name}}, external_ip_address]}
+      InternalApiIpList: {get_attr: [{{role.name}}, internal_api_ip_address]}
+      StorageIpList: {get_attr: [{{role.name}}, storage_ip_address]}
+      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]}
+      ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
+      ServiceHostnameList: {get_attr: [{{role.name}}, hostname]}
+      NetworkHostnameMap:
+        # Note (shardy) this somewhat complex yaql may be replaced
+        # with a map_deep_merge function in ocata.  It merges the
+        # list of maps, but appends to colliding lists so we can
+        # create a map of lists for all nodes for each network
+        yaql:
+          expression: dict($.data.where($ != null).flatten().selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()]))
+          data:
+            - {get_attr: [{{role.name}}, hostname_map]}
+
+  {{role.name}}:
     type: OS::Heat::ResourceGroup
     depends_on: Networks
     properties:
-      count: {get_param: ComputeCount}
-      removal_policies: {get_param: ComputeRemovalPolicies}
+      count: {get_param: {{role.name}}Count}
+      removal_policies: {get_param: {{role.name}}RemovalPolicies}
       resource_def:
-        type: OS::TripleO::Compute
+        type: OS::TripleO::{{role.name}}
         properties:
           CloudDomain: {get_param: CloudDomain}
-          NeutronPhysicalBridge: {get_param: HypervisorNeutronPhysicalBridge}
-          NeutronPublicInterface: {get_param: HypervisorNeutronPublicInterface}
           ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
           EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
           Hostname:
             str_replace:
-              template: {get_param: ComputeHostnameFormat}
+              template: {get_param: {{role.name}}HostnameFormat}
               params:
                 '%stackname%': {get_param: 'OS::stack_name'}
           NodeIndex: '%index%'
+  {% if role.name != 'Compute' %}
+          {{role.name}}SchedulerHints: {get_param: {{role.name}}SchedulerHints}
+  {% else %}
+          NovaComputeSchedulerHints: {get_param: NovaComputeSchedulerHints}
+  {% endif %}
           ServiceConfigSettings:
             map_merge:
-              - get_attr: [ComputeServiceChain, role_data, config_settings]
-              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
-              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
-              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
-          ServiceNames: {get_attr: [ComputeServiceChain, role_data, service_names]}
-          MonitoringSubscriptions: {get_attr: [ComputeServiceChain, role_data, monitoring_subscriptions]}
-
-  BlockStorage:
-    type: OS::Heat::ResourceGroup
-    depends_on: Networks
-    properties:
-      count: {get_param: BlockStorageCount}
-      removal_policies: {get_param: BlockStorageRemovalPolicies}
-      resource_def:
-        type: OS::TripleO::BlockStorage
-        properties:
-          UpdateIdentifier: {get_param: UpdateIdentifier}
-          Hostname:
-            str_replace:
-              template: {get_param: BlockStorageHostnameFormat}
-              params:
-                '%stackname%': {get_param: 'OS::stack_name'}
-          ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
-          CloudDomain: {get_param: CloudDomain}
-          ServerMetadata: {get_param: ServerMetadata}
-          NodeIndex: '%index%'
-          ServiceConfigSettings:
-            map_merge:
-              - get_attr: [BlockStorageServiceChain, role_data, config_settings]
-              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
-              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
-              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
-          ServiceNames: {get_attr: [BlockStorageServiceChain, role_data, service_names]}
-          MonitoringSubscriptions: {get_attr: [BlockStorageServiceChain, role_data, monitoring_subscriptions]}
-
-  ObjectStorage:
-    type: OS::Heat::ResourceGroup
-    depends_on: Networks
-    properties:
-      count: {get_param: ObjectStorageCount}
-      removal_policies: {get_param: ObjectStorageRemovalPolicies}
-      resource_def:
-        type: OS::TripleO::ObjectStorage
-        properties:
-          UpdateIdentifier: {get_param: UpdateIdentifier}
-          ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
-          Hostname:
-            str_replace:
-              template: {get_param: ObjectStorageHostnameFormat}
-              params:
-                '%stackname%': {get_param: 'OS::stack_name'}
-          CloudDomain: {get_param: CloudDomain}
-          ServerMetadata: {get_param: ServerMetadata}
-          NodeIndex: '%index%'
-          ServiceConfigSettings:
-            map_merge:
-              - get_attr: [ObjectStorageServiceChain, role_data, config_settings]
-              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
-              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
-              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
-          ServiceNames: {get_attr: [ObjectStorageServiceChain, role_data, service_names]}
-          MonitoringSubscriptions: {get_attr: [ObjectStorageServiceChain, role_data, monitoring_subscriptions]}
-
-  CephStorage:
-    type: OS::Heat::ResourceGroup
-    depends_on: Networks
-    properties:
-      count: {get_param: CephStorageCount}
-      removal_policies: {get_param: CephStorageRemovalPolicies}
-      resource_def:
-        type: OS::TripleO::CephStorage
-        properties:
-          ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
-          UpdateIdentifier: {get_param: UpdateIdentifier}
-          Hostname:
-            str_replace:
-              template: {get_param: CephStorageHostnameFormat}
-              params:
-                '%stackname%': {get_param: 'OS::stack_name'}
-          CloudDomain: {get_param: CloudDomain}
-          ServerMetadata: {get_param: ServerMetadata}
-          NodeIndex: '%index%'
-          ServiceConfigSettings:
-            map_merge:
-              - get_attr: [CephStorageServiceChain, role_data, config_settings]
-              - get_attr: [ControllerServiceChain, role_data, global_config_settings]
-              - get_attr: [ComputeServiceChain, role_data, global_config_settings]
-              - get_attr: [BlockStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [ObjectStorageServiceChain, role_data, global_config_settings]
-              - get_attr: [CephStorageServiceChain, role_data, global_config_settings]
-          ServiceNames: {get_attr: [CephStorageServiceChain, role_data, service_names]}
-          MonitoringSubscriptions: {get_attr: [CephStorageServiceChain, role_data, monitoring_subscriptions]}
-
-  ControllerIpListMap:
-    type: OS::TripleO::Network::Ports::NetIpListMap
-    properties:
-      ControlPlaneIpList: {get_attr: [Controller, ip_address]}
-      ExternalIpList: {get_attr: [Controller, external_ip_address]}
-      InternalApiIpList: {get_attr: [Controller, internal_api_ip_address]}
-      StorageIpList: {get_attr: [Controller, storage_ip_address]}
-      StorageMgmtIpList: {get_attr: [Controller, storage_mgmt_ip_address]}
-      TenantIpList: {get_attr: [Controller, tenant_ip_address]}
-      ManagementIpList: {get_attr: [Controller, management_ip_address]}
-      EnabledServices: {get_attr: [ControllerServiceChain, role_data, service_names]}
-      ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
-      ServiceHostnameList: {get_attr: [Controller, hostname]}
-
-  ComputeIpListMap:
-    type: OS::TripleO::Network::Ports::NetIpListMap
-    properties:
-      ControlPlaneIpList: {get_attr: [Compute, ip_address]}
-      ExternalIpList: {get_attr: [Compute, external_ip_address]}
-      InternalApiIpList: {get_attr: [Compute, internal_api_ip_address]}
-      StorageIpList: {get_attr: [Compute, storage_ip_address]}
-      StorageMgmtIpList: {get_attr: [Compute, storage_mgmt_ip_address]}
-      TenantIpList: {get_attr: [Compute, tenant_ip_address]}
-      ManagementIpList: {get_attr: [Compute, management_ip_address]}
-      EnabledServices: {get_attr: [ComputeServiceChain, role_data, service_names]}
-      ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
-      ServiceHostnameList: {get_attr: [Compute, hostname]}
-
-  BlockStorageIpListMap:
-    type: OS::TripleO::Network::Ports::NetIpListMap
-    properties:
-      ControlPlaneIpList: {get_attr: [BlockStorage, ip_address]}
-      ExternalIpList: {get_attr: [BlockStorage, external_ip_address]}
-      InternalApiIpList: {get_attr: [BlockStorage, internal_api_ip_address]}
-      StorageIpList: {get_attr: [BlockStorage, storage_ip_address]}
-      StorageMgmtIpList: {get_attr: [BlockStorage, storage_mgmt_ip_address]}
-      TenantIpList: {get_attr: [BlockStorage, tenant_ip_address]}
-      ManagementIpList: {get_attr: [BlockStorage, management_ip_address]}
-      EnabledServices: {get_attr: [BlockStorageServiceChain, role_data, service_names]}
-      ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
-      ServiceHostnameList: {get_attr: [BlockStorage, hostname]}
-
-  ObjectStorageIpListMap:
-    type: OS::TripleO::Network::Ports::NetIpListMap
-    properties:
-      ControlPlaneIpList: {get_attr: [ObjectStorage, ip_address]}
-      ExternalIpList: {get_attr: [ObjectStorage, external_ip_address]}
-      InternalApiIpList: {get_attr: [ObjectStorage, internal_api_ip_address]}
-      StorageIpList: {get_attr: [ObjectStorage, storage_ip_address]}
-      StorageMgmtIpList: {get_attr: [ObjectStorage, storage_mgmt_ip_address]}
-      TenantIpList: {get_attr: [ObjectStorage, tenant_ip_address]}
-      ManagementIpList: {get_attr: [ObjectStorage, management_ip_address]}
-      EnabledServices: {get_attr: [ObjectStorageServiceChain, role_data, service_names]}
-      ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
-      ServiceHostnameList: {get_attr: [ObjectStorage, hostname]}
-
-  CephStorageIpListMap:
-    type: OS::TripleO::Network::Ports::NetIpListMap
-    properties:
-      ControlPlaneIpList: {get_attr: [CephStorage, ip_address]}
-      ExternalIpList: {get_attr: [CephStorage, external_ip_address]}
-      InternalApiIpList: {get_attr: [CephStorage, internal_api_ip_address]}
-      StorageIpList: {get_attr: [CephStorage, storage_ip_address]}
-      StorageMgmtIpList: {get_attr: [CephStorage, storage_mgmt_ip_address]}
-      TenantIpList: {get_attr: [CephStorage, tenant_ip_address]}
-      ManagementIpList: {get_attr: [CephStorage, management_ip_address]}
-      EnabledServices: {get_attr: [CephStorageServiceChain, role_data, service_names]}
-      ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
-      ServiceHostnameList: {get_attr: [CephStorage, hostname]}
+              -  get_attr: [{{role.name}}ServiceChain, role_data, config_settings]
+          {% for r in roles %}
+              - get_attr: [{{r.name}}ServiceChain, role_data, global_config_settings]
+          {% endfor %}
+              # This next step combines two yaql passes:
+              # - The inner one does a deep merge on the service_config_settings for all roles
+              # - The outer one filters the map based on the services enabled for the role
+              #   then merges the result into one map.
+              - yaql:
+                  expression: let(root => $) -> $.data.map.items().where($[0] in $root.data.services).select($[1]).reduce($1.mergeWith($2), {})
+                  data:
+                    map:
+                      yaql:
+                        expression: $.data.where($ != null).reduce($1.mergeWith($2), {})
+                        data:
+                        {% 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]}
+          MonitoringSubscriptions: {get_attr: [{{role.name}}ServiceChain, role_data, monitoring_subscriptions]}
+{% endfor %}
 
   allNodesConfig:
     type: OS::TripleO::AllNodes::SoftwareConfig
@@ -514,29 +312,35 @@ resources:
       cloud_name_storage_mgmt: {get_param: CloudNameStorageManagement}
       cloud_name_ctlplane: {get_param: CloudNameCtlplane}
       hosts:
+{% for role in roles %}
         - list_join:
             - '\n'
-            - {get_attr: [Compute, hosts_entry]}
-        - list_join:
-            - '\n'
-            - {get_attr: [Controller, hosts_entry]}
-        - list_join:
-            - '\n'
-            - {get_attr: [BlockStorage, hosts_entry]}
-        - list_join:
-            - '\n'
-            - {get_attr: [ObjectStorage, hosts_entry]}
-        - list_join:
-            - '\n'
-            - {get_attr: [CephStorage, hosts_entry]}
+            - {get_attr: [{{role.name}}, hosts_entry]}
+{% endfor %}
       enabled_services:
         list_join:
           - ','
-          - {get_attr: [ControllerServiceChain, role_data, service_names]}
-          - {get_attr: [ComputeServiceChain, role_data, service_names]}
-          - {get_attr: [BlockStorageServiceChain, role_data, service_names]}
-          - {get_attr: [ObjectStorageServiceChain, role_data, service_names]}
-          - {get_attr: [CephStorageServiceChain, role_data, service_names]}
+{% for role in roles %}
+          - {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+{% endfor %}
+      logging_groups:
+        yaql:
+          expression: >
+            $.data.groups.flatten()
+          data:
+            groups:
+{% for role in roles %}
+              - {get_attr: [{{role.name}}ServiceChain, role_data, logging_groups]}
+{% endfor %}
+      logging_sources:
+        yaql:
+          expression: >
+            $.data.sources.flatten()
+          data:
+            sources:
+{% for role in roles %}
+              - {get_attr: [{{role.name}}ServiceChain, role_data, logging_sources]}
+{% endfor %}
       controller_ips: {get_attr: [Controller, ip_address]}
       controller_names: {get_attr: [Controller, hostname]}
       service_ips:
@@ -548,25 +352,27 @@ resources:
           expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()]))
           data:
             l:
-              - {get_attr: [ControllerIpListMap, service_ips]}
-              - {get_attr: [ComputeIpListMap, service_ips]}
-              - {get_attr: [BlockStorageIpListMap, service_ips]}
-              - {get_attr: [ObjectStorageIpListMap, service_ips]}
-              - {get_attr: [CephStorageIpListMap, service_ips]}
+{% for role in roles %}
+              - {get_attr: [{{role.name}}IpListMap, service_ips]}
+{% endfor %}
       service_node_names:
         yaql:
           expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()]))
           data:
             l:
-              - {get_attr: [ControllerIpListMap, service_hostnames]}
-              - {get_attr: [ComputeIpListMap, service_hostnames]}
-              - {get_attr: [BlockStorageIpListMap, service_hostnames]}
-              - {get_attr: [ObjectStorageIpListMap, service_hostnames]}
-              - {get_attr: [CephStorageIpListMap, service_hostnames]}
+{% for role in roles %}
+              - {get_attr: [{{role.name}}IpListMap, service_hostnames]}
+{% endfor %}
+      short_service_node_names:
+        yaql:
+          expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1], [$[0], $[1].flatten()]))
+          data:
+            l:
+{% for role in roles %}
+              - {get_attr: [{{role.name}}IpListMap, short_service_hostnames]}
+{% endfor %}
       # FIXME(shardy): These require further work to move into service_ips
       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]}]}
       NetVipMap: {get_attr: [VipMap, net_ip_map]}
       RedisVirtualIP: {get_attr: [RedisVirtualIP, ip_address]}
       ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map_lower]}
@@ -681,12 +487,15 @@ resources:
 
   UpdateWorkflow:
     type: OS::TripleO::Tasks::UpdateWorkflow
+    depends_on:
+{% for role in roles %}
+      - {{role.name}}AllNodesDeployment
+{% endfor %}
     properties:
-      controller_servers: {get_attr: [Controller, attributes, nova_server_resource]}
-      compute_servers: {get_attr: [Compute, attributes, nova_server_resource]}
-      blockstorage_servers: {get_attr: [BlockStorage, attributes, nova_server_resource]}
-      objectstorage_servers: {get_attr: [ObjectStorage, attributes, nova_server_resource]}
-      cephstorage_servers: {get_attr: [CephStorage, attributes, nova_server_resource]}
+      servers:
+{% for role in roles %}
+        {{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
+{% endfor %}
       input_values:
         deploy_identifier: {get_param: DeployIdentifier}
         update_identifier: {get_param: UpdateIdentifier}
@@ -697,34 +506,26 @@ resources:
     type: OS::TripleO::AllNodesExtraConfig
     depends_on:
       - UpdateWorkflow
-      - ComputeAllNodesValidationDeployment
-      - BlockStorageAllNodesValidationDeployment
-      - ObjectStorageAllNodesValidationDeployment
-      - CephStorageAllNodesValidationDeployment
-      - ControllerAllNodesValidationDeployment
+{% for role in roles %}
+      - {{role.name}}AllNodesValidationDeployment
+{% endfor %}
     properties:
-      controller_servers: {get_attr: [Controller, attributes, nova_server_resource]}
-      compute_servers: {get_attr: [Compute, attributes, nova_server_resource]}
-      blockstorage_servers: {get_attr: [BlockStorage, attributes, nova_server_resource]}
-      objectstorage_servers: {get_attr: [ObjectStorage, attributes, nova_server_resource]}
-      cephstorage_servers: {get_attr: [CephStorage, attributes, nova_server_resource]}
+{% for role in roles %}
+      servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
+{% endfor %}
 
   # Post deployment steps for all roles
   AllNodesDeploySteps:
     type: OS::TripleO::PostDeploySteps
     properties:
       servers:
-        Controller: {get_attr: [Controller, attributes, nova_server_resource]}
-        Compute: {get_attr: [Compute, attributes, nova_server_resource]}
-        BlockStorage: {get_attr: [BlockStorage, attributes, nova_server_resource]}
-        ObjectStorage: {get_attr: [ObjectStorage, attributes, nova_server_resource]}
-        CephStorage: {get_attr: [CephStorage, attributes, nova_server_resource]}
+{% for role in roles %}
+        {{role.name}}: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
+{% endfor %}
       role_data:
-        Controller: {get_attr: [ControllerServiceChain, role_data]}
-        Compute: {get_attr: [ComputeServiceChain, role_data]}
-        BlockStorage: {get_attr: [BlockStorageServiceChain, role_data]}
-        ObjectStorage: {get_attr: [ObjectStorageServiceChain, role_data]}
-        CephStorage: {get_attr: [CephStorageServiceChain, role_data]}
+{% for role in roles %}
+        {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data]}
+{% endfor %}
 
 outputs:
   ManagedEndpoints:
@@ -745,6 +546,9 @@ outputs:
   CeilometerInternalVip:
     description: VIP for Ceilometer API internal endpoint
     value: {get_attr: [VipMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, CeilometerApiNetwork]}]}
+  CephRgwInternalVip:
+    description: VIP for Ceph RGW internal endpoint
+    value: {get_attr: [VipMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, CephRgwNetwork]}]}
   CinderInternalVip:
     description: VIP for Cinder API internal endpoint
     value: {get_attr: [VipMap, net_ip_map, {get_attr: [ServiceNetMap, service_net_map, CinderApiNetwork]}]}
@@ -792,12 +596,39 @@ outputs:
       The content that should be appended to your /etc/hosts if you want to get
       hostname-based access to the deployed nodes (useful for testing without
       setting up a DNS).
-    value: {get_attr: [allNodesConfig, hosts_entries]}
+    value:
+      list_join:
+      - "\n"
+      - - {get_attr: [allNodesConfig, hosts_entries]}
+      -
+        - str_replace:
+            template: IP  HOST
+            params:
+              IP: {get_attr: [VipMap, net_ip_map, external]}
+              HOST: {get_param: CloudName}
+        - str_replace:
+            template: IP  HOST
+            params:
+              IP: {get_attr: [VipMap, net_ip_map, ctlplane]}
+              HOST: {get_param: CloudNameCtlplane}
+        - str_replace:
+            template: IP  HOST
+            params:
+              IP: {get_attr: [VipMap, net_ip_map, internal_api]}
+              HOST: {get_param: CloudNameInternal}
+        - str_replace:
+            template: IP  HOST
+            params:
+              IP: {get_attr: [VipMap, net_ip_map, storage]}
+              HOST: {get_param: CloudNameStorage}
+        - str_replace:
+            template: IP  HOST
+            params:
+              IP: {get_attr: [VipMap, net_ip_map, storage_mgmt]}
+              HOST: {get_param: CloudNameStorageManagement}
   EnabledServices:
     description: The services enabled on each role
     value:
-      Controller: {get_attr: [ControllerServiceChain, role_data, service_names]}
-      Compute: {get_attr: [ComputeServiceChain, role_data, service_names]}
-      BlockStorage: {get_attr: [BlockStorageServiceChain, role_data, service_names]}
-      ObjectStorage: {get_attr: [ObjectStorageServiceChain, role_data, service_names]}
-      CephStorage: {get_attr: [CephStorageServiceChain, role_data, service_names]}
+{% for role in roles %}
+      {{role.name}}: {get_attr: [{{role.name}}ServiceChain, role_data, service_names]}
+{% endfor %}