Remove spurious for loop from post deploy j2
authorSteven Hardy <shardy@redhat.com>
Tue, 24 Jan 2017 23:17:50 +0000 (23:17 +0000)
committerSteven Hardy <shardy@redhat.com>
Tue, 24 Jan 2017 23:17:50 +0000 (23:17 +0000)
This nested for loop is wrong as it generates all steps for all
roles twice.  This works because yaml parsing ignores the duplicate
resources, but it's a big waste of space in swift (this fix reduces
the rendered file size by over 2000 lines with the default roles!)

Change-Id: Ifaf860020839390147c92848d52b1a59e355dc50
Closes-Bug: #1659139

puppet/post.j2.yaml

index 2a02ea1..83c3286 100644 (file)
@@ -21,11 +21,10 @@ parameters:
       perform configuration on a Heat stack-update.
 
 resources:
-
-{% for role in roles %}
   # Post deployment steps for all roles
   # A single config is re-applied with an incrementing step number
-  # {{role.name}} Role steps
+{% for role in roles %}
+  # {{role.name}} Role post deploy steps
   {{role.name}}ArtifactsConfig:
     type: deploy-artifacts.yaml
 
@@ -58,8 +57,6 @@ resources:
 
   # Step through a series of configuration steps
 {% for step in range(1, 6) %}
-  {% for role in roles %}
-
   {{role.name}}Deployment_Step{{step}}:
     type: OS::Heat::StructuredDeploymentGroup
   {% if step == 1 %}
@@ -77,8 +74,6 @@ resources:
       input_values:
         step: {{step}}
         update_identifier: {get_param: DeployIdentifier}
-
-  {% endfor %}
 {% endfor %}
 
   {{role.name}}PostConfig: