summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Herve <therve@redhat.com>2018-12-10 18:47:41 +0100
committerThomas Herve <therve@redhat.com>2018-12-12 09:50:36 +0100
commiteb3efe713335eda22cc58ca8f18cd7d209a16ac6 (patch)
tree7cd9331a1ffeba0d2540c4730aa998adbe7bdb56
parent1201d46ee319673e1d114b05837cf697864552fe (diff)
Remove deploy steps on empty roles
When a role count is 0, we can create the deployment resources conditionally. Closes-Bug: #1671859 Change-Id: I467b9ded1a1b33d520cb69aa86b253a0552643f7
Notes
Notes (review): Code-Review+2: Emilien Macchi <emilien@redhat.com> Code-Review+2: Alex Schultz <aschultz@redhat.com> Verified-1: RDO Third Party CI <dmsimard+rdothirdparty@redhat.com> Workflow+1: Alex Schultz <aschultz@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 14 Dec 2018 22:38:31 +0000 Reviewed-on: https://review.openstack.org/624145 Project: openstack/tripleo-heat-templates Branch: refs/heads/master
-rw-r--r--common/deploy-steps.j217
-rw-r--r--overcloud.j2.yaml3
2 files changed, 20 insertions, 0 deletions
diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2
index 33bb276..e5a68e8 100644
--- a/common/deploy-steps.j2
+++ b/common/deploy-steps.j2
@@ -107,6 +107,12 @@ parameters:
107 type: string 107 type: string
108 description: The python interpreter to use for python and ansible actions 108 description: The python interpreter to use for python and ansible actions
109 default: /usr/bin/python 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
111conditions: 117conditions:
112{% for step in range(1, deploy_steps_max) %} 118{% for step in range(1, deploy_steps_max) %}
@@ -120,6 +126,13 @@ conditions:
120 - False 126 - False
121 {%- endfor %} 127 {%- endfor %}
122{% endfor %} 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
124resources: 137resources:
125 138
@@ -304,6 +317,7 @@ resources:
304 317
305 {{role.name}}ArtifactsDeploy: 318 {{role.name}}ArtifactsDeploy:
306 type: OS::Heat::StructuredDeploymentGroup 319 type: OS::Heat::StructuredDeploymentGroup
320 condition: {{role.name}}NonZero
307 properties: 321 properties:
308 name: {{role.name}}ArtifactsDeploy 322 name: {{role.name}}ArtifactsDeploy
309 servers: {get_param: [servers, {{role.name}}]} 323 servers: {get_param: [servers, {{role.name}}]}
@@ -317,6 +331,7 @@ resources:
317 {% for step in range(1, deploy_steps_max) %} 331 {% for step in range(1, deploy_steps_max) %}
318 {{role.name}}Deployment_Step{{step}}: 332 {{role.name}}Deployment_Step{{step}}:
319 type: OS::TripleO::DeploymentSteps 333 type: OS::TripleO::DeploymentSteps
334 condition: {{role.name}}NonZero
320 depends_on: 335 depends_on:
321 - WorkflowTasks_Step{{step}}_Execution 336 - WorkflowTasks_Step{{step}}_Execution
322 # TODO(gfidente): the following if/else condition 337 # TODO(gfidente): the following if/else condition
@@ -363,6 +378,7 @@ resources:
363 # Ensure that all {{role.name}}ExtraConfigPost steps are executed 378 # Ensure that all {{role.name}}ExtraConfigPost steps are executed
364 # after all the previous deployment steps. 379 # after all the previous deployment steps.
365 {{role.name}}ExtraConfigPost: 380 {{role.name}}ExtraConfigPost:
381 condition: {{role.name}}NonZero
366 depends_on: 382 depends_on:
367 {%- for dep in enabled_roles %} 383 {%- for dep in enabled_roles %}
368 - {{dep.name}}Deployment_Step{{deploy_steps_max - 1}} 384 - {{dep.name}}Deployment_Step{{deploy_steps_max - 1}}
@@ -375,6 +391,7 @@ resources:
375 # quiescing all services, i.e. in the Controller case, 391 # quiescing all services, i.e. in the Controller case,
376 # we should run a full service reload. 392 # we should run a full service reload.
377 {{role.name}}PostConfig: 393 {{role.name}}PostConfig:
394 condition: {{role.name}}NonZero
378 type: OS::TripleO::Tasks::{{role.name}}PostConfig 395 type: OS::TripleO::Tasks::{{role.name}}PostConfig
379 depends_on: 396 depends_on:
380 {%- for dep in enabled_roles %} 397 {%- for dep in enabled_roles %}
diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml
index 98c1cec..393e6b4 100644
--- a/overcloud.j2.yaml
+++ b/overcloud.j2.yaml
@@ -942,6 +942,9 @@ resources:
942 blacklisted_ip_addresses: {get_attr: [BlacklistedIpAddresses, value]} 942 blacklisted_ip_addresses: {get_attr: [BlacklistedIpAddresses, value]}
943 blacklisted_hostnames: {get_attr: [BlacklistedHostnames, value]} 943 blacklisted_hostnames: {get_attr: [BlacklistedHostnames, value]}
944 ssh_known_hosts_hostnames: {get_attr: [SshKnownHostsHostnames, value]} 944 ssh_known_hosts_hostnames: {get_attr: [SshKnownHostsHostnames, value]}
945{% for role in roles %}
946 {{role.name}}Count: {get_param: {{role.name}}Count}
947{% endfor %}
945 948
946 ServerOsCollectConfigData: 949 ServerOsCollectConfigData:
947 type: OS::Heat::Value 950 type: OS::Heat::Value