Move AllNodesDeployments into jinja template loop
authorSteven Hardy <shardy@redhat.com>
Fri, 1 Jul 2016 16:33:07 +0000 (17:33 +0100)
committerJames Slagle <jslagle@redhat.com>
Fri, 9 Sep 2016 20:23:53 +0000 (16:23 -0400)
These are identical for all roles, so move them into the per-role
loop

Partially-Implements: blueprint custom-roles
Change-Id: I0a9918d5a2e9a73fe3ac68a96bdee02e95799bc1

overcloud.j2.yaml

index e8abd2c..16db379 100644 (file)
@@ -252,7 +252,7 @@ resources:
       NetIpMap: {get_attr: [VipMap, net_ip_map]}
       ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
 
-  # Jinja loop for Role in role_data.yaml
+  # Jinja loop for Role in roles_data.yaml
 {% for role in roles %}
   # Resources generated for {{role.name}} Role
   {{role.name}}ServiceChain:
@@ -263,6 +263,16 @@ resources:
       ServiceNetMap: {get_attr: [ServiceNetMap, service_net_map]}
       EndpointMap: {get_attr: [EndpointMap, endpoint_map]}
       DefaultPasswords: {get_attr: [DefaultPasswords, passwords]}
+
+  {{role.name}}AllNodesDeployment:
+    type: OS::Heat::StructuredDeployments
+    properties:
+      name: {{role.name}}AllNodesDeployment
+      config: {get_attr: [allNodesConfig, config_id]}
+      servers: {get_attr: [{{role.name}}, attributes, nova_server_resource]}
+      input_values:
+        bootstrap_nodeid: {get_attr: [{{role.name}}, resource.0.hostname]}
+        bootstrap_nodeid_ip: {get_attr: [{{role.name}}, resource.0.ip_address]}
 {% endfor %}
 
   Controller:
@@ -646,56 +656,6 @@ resources:
       StorageMgmtIpUri: {get_attr: [StorageMgmtVirtualIP, ip_address_uri]}
       # No tenant or management VIP required
 
-  ControllerAllNodesDeployment:
-    type: OS::Heat::StructuredDeployments
-    properties:
-      name: ControllerAllNodesDeployment
-      config: {get_attr: [allNodesConfig, config_id]}
-      servers: {get_attr: [Controller, attributes, nova_server_resource]}
-      input_values:
-        bootstrap_nodeid: {get_attr: [Controller, resource.0.hostname]}
-        bootstrap_nodeid_ip: {get_attr: [Controller, resource.0.ip_address]}
-
-  ComputeAllNodesDeployment:
-    type: OS::Heat::StructuredDeployments
-    properties:
-      name: ComputeAllNodesDeployment
-      config: {get_attr: [allNodesConfig, config_id]}
-      servers: {get_attr: [Compute, attributes, nova_server_resource]}
-      input_values:
-        bootstrap_nodeid: {get_attr: [Compute, resource.0.hostname]}
-        bootstrap_nodeid_ip: {get_attr: [Compute, resource.0.ip_address]}
-
-  BlockStorageAllNodesDeployment:
-    type: OS::Heat::StructuredDeployments
-    properties:
-      name: BlockStorageAllNodesDeployment
-      config: {get_attr: [allNodesConfig, config_id]}
-      servers: {get_attr: [BlockStorage, attributes, nova_server_resource]}
-      input_values:
-        bootstrap_nodeid: {get_attr: [BlockStorage, resource.0.hostname]}
-        bootstrap_nodeid_ip: {get_attr: [BlockStorage, resource.0.ip_address]}
-
-  ObjectStorageAllNodesDeployment:
-    type: OS::Heat::StructuredDeployments
-    properties:
-      name: ObjectStorageAllNodesDeployment
-      config: {get_attr: [allNodesConfig, config_id]}
-      servers: {get_attr: [ObjectStorage, attributes, nova_server_resource]}
-      input_values:
-        bootstrap_nodeid: {get_attr: [ObjectStorage, resource.0.hostname]}
-        bootstrap_nodeid_ip: {get_attr: [ObjectStorage, resource.0.ip_address]}
-
-  CephStorageAllNodesDeployment:
-    type: OS::Heat::StructuredDeployments
-    properties:
-      name: CephStorageAllNodesDeployment
-      config: {get_attr: [allNodesConfig, config_id]}
-      servers: {get_attr: [CephStorage, attributes, nova_server_resource]}
-      input_values:
-        bootstrap_nodeid: {get_attr: [CephStorage, resource.0.hostname]}
-        bootstrap_nodeid_ip: {get_attr: [CephStorage, resource.0.ip_address]}
-
   # All Nodes Validations
   AllNodesValidationConfig:
     type: OS::TripleO::AllNodes::Validation