Browse Source

Merge "Remove deploy steps on empty roles"

tags/10.3.0
Zuul 6 months ago
parent
commit
707cfc90c6
2 changed files with 20 additions and 0 deletions
  1. 17
    0
      common/deploy-steps.j2
  2. 3
    0
      overcloud.j2.yaml

+ 17
- 0
common/deploy-steps.j2 View File

@@ -107,6 +107,12 @@ parameters:
107 107
     type: string
108 108
     description: The python interpreter to use for python and ansible actions
109 109
     default: /usr/bin/python
110
+{% for role in enabled_roles %}
111
+  {{role.name}}Count:
112
+    description: Number of {{role.name}} nodes to deploy
113
+    type: number
114
+    default: {{role.CountDefault|default(0)}}
115
+{% endfor %}
110 116
 
111 117
 conditions:
112 118
 {% for step in range(1, deploy_steps_max) %}
@@ -120,6 +126,13 @@ conditions:
120 126
       - False
121 127
     {%- endfor %}
122 128
 {% endfor %}
129
+{% for role in enabled_roles %}
130
+  {{role.name}}NonZero:
131
+     not:
132
+       equals:
133
+         - {get_param: {{role.name}}Count}
134
+         - 0
135
+{% endfor %}
123 136
 
124 137
 resources:
125 138
 
@@ -304,6 +317,7 @@ resources:
304 317
 
305 318
   {{role.name}}ArtifactsDeploy:
306 319
     type: OS::Heat::StructuredDeploymentGroup
320
+    condition: {{role.name}}NonZero
307 321
     properties:
308 322
       name: {{role.name}}ArtifactsDeploy
309 323
       servers:  {get_param: [servers, {{role.name}}]}
@@ -317,6 +331,7 @@ resources:
317 331
   {% for step in range(1, deploy_steps_max) %}
318 332
   {{role.name}}Deployment_Step{{step}}:
319 333
     type: OS::TripleO::DeploymentSteps
334
+    condition: {{role.name}}NonZero
320 335
     depends_on:
321 336
       - WorkflowTasks_Step{{step}}_Execution
322 337
     # TODO(gfidente): the following if/else condition
@@ -363,6 +378,7 @@ resources:
363 378
   # Ensure that all {{role.name}}ExtraConfigPost steps are executed
364 379
   # after all the previous deployment steps.
365 380
   {{role.name}}ExtraConfigPost:
381
+    condition: {{role.name}}NonZero
366 382
     depends_on:
367 383
   {%- for dep in enabled_roles %}
368 384
       - {{dep.name}}Deployment_Step{{deploy_steps_max - 1}}
@@ -375,6 +391,7 @@ resources:
375 391
   # quiescing all services, i.e. in the Controller case,
376 392
   # we should run a full service reload.
377 393
   {{role.name}}PostConfig:
394
+    condition: {{role.name}}NonZero
378 395
     type: OS::TripleO::Tasks::{{role.name}}PostConfig
379 396
     depends_on:
380 397
   {%- for dep in enabled_roles %}

+ 3
- 0
overcloud.j2.yaml View File

@@ -970,6 +970,9 @@ resources:
970 970
       blacklisted_ip_addresses: {get_attr: [BlacklistedIpAddresses, value]}
971 971
       blacklisted_hostnames: {get_attr: [BlacklistedHostnames, value]}
972 972
       ssh_known_hosts_hostnames: {get_attr: [SshKnownHostsHostnames, value]}
973
+{% for role in roles %}
974
+      {{role.name}}Count: {get_param: {{role.name}}Count}
975
+{% endfor %}
973 976
 
974 977
   ServerOsCollectConfigData:
975 978
     type: OS::Heat::Value

Loading…
Cancel
Save