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
This commit is contained in:
parent
1201d46ee3
commit
eb3efe7133
|
@ -107,6 +107,12 @@ parameters:
|
||||||
type: string
|
type: string
|
||||||
description: The python interpreter to use for python and ansible actions
|
description: The python interpreter to use for python and ansible actions
|
||||||
default: /usr/bin/python
|
default: /usr/bin/python
|
||||||
|
{% for role in enabled_roles %}
|
||||||
|
{{role.name}}Count:
|
||||||
|
description: Number of {{role.name}} nodes to deploy
|
||||||
|
type: number
|
||||||
|
default: {{role.CountDefault|default(0)}}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
conditions:
|
conditions:
|
||||||
{% for step in range(1, deploy_steps_max) %}
|
{% for step in range(1, deploy_steps_max) %}
|
||||||
|
@ -120,6 +126,13 @@ conditions:
|
||||||
- False
|
- False
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% for role in enabled_roles %}
|
||||||
|
{{role.name}}NonZero:
|
||||||
|
not:
|
||||||
|
equals:
|
||||||
|
- {get_param: {{role.name}}Count}
|
||||||
|
- 0
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
resources:
|
resources:
|
||||||
|
|
||||||
|
@ -304,6 +317,7 @@ resources:
|
||||||
|
|
||||||
{{role.name}}ArtifactsDeploy:
|
{{role.name}}ArtifactsDeploy:
|
||||||
type: OS::Heat::StructuredDeploymentGroup
|
type: OS::Heat::StructuredDeploymentGroup
|
||||||
|
condition: {{role.name}}NonZero
|
||||||
properties:
|
properties:
|
||||||
name: {{role.name}}ArtifactsDeploy
|
name: {{role.name}}ArtifactsDeploy
|
||||||
servers: {get_param: [servers, {{role.name}}]}
|
servers: {get_param: [servers, {{role.name}}]}
|
||||||
|
@ -317,6 +331,7 @@ resources:
|
||||||
{% for step in range(1, deploy_steps_max) %}
|
{% for step in range(1, deploy_steps_max) %}
|
||||||
{{role.name}}Deployment_Step{{step}}:
|
{{role.name}}Deployment_Step{{step}}:
|
||||||
type: OS::TripleO::DeploymentSteps
|
type: OS::TripleO::DeploymentSteps
|
||||||
|
condition: {{role.name}}NonZero
|
||||||
depends_on:
|
depends_on:
|
||||||
- WorkflowTasks_Step{{step}}_Execution
|
- WorkflowTasks_Step{{step}}_Execution
|
||||||
# TODO(gfidente): the following if/else condition
|
# TODO(gfidente): the following if/else condition
|
||||||
|
@ -363,6 +378,7 @@ resources:
|
||||||
# Ensure that all {{role.name}}ExtraConfigPost steps are executed
|
# Ensure that all {{role.name}}ExtraConfigPost steps are executed
|
||||||
# after all the previous deployment steps.
|
# after all the previous deployment steps.
|
||||||
{{role.name}}ExtraConfigPost:
|
{{role.name}}ExtraConfigPost:
|
||||||
|
condition: {{role.name}}NonZero
|
||||||
depends_on:
|
depends_on:
|
||||||
{%- for dep in enabled_roles %}
|
{%- for dep in enabled_roles %}
|
||||||
- {{dep.name}}Deployment_Step{{deploy_steps_max - 1}}
|
- {{dep.name}}Deployment_Step{{deploy_steps_max - 1}}
|
||||||
|
@ -375,6 +391,7 @@ resources:
|
||||||
# quiescing all services, i.e. in the Controller case,
|
# quiescing all services, i.e. in the Controller case,
|
||||||
# we should run a full service reload.
|
# we should run a full service reload.
|
||||||
{{role.name}}PostConfig:
|
{{role.name}}PostConfig:
|
||||||
|
condition: {{role.name}}NonZero
|
||||||
type: OS::TripleO::Tasks::{{role.name}}PostConfig
|
type: OS::TripleO::Tasks::{{role.name}}PostConfig
|
||||||
depends_on:
|
depends_on:
|
||||||
{%- for dep in enabled_roles %}
|
{%- for dep in enabled_roles %}
|
||||||
|
|
|
@ -942,6 +942,9 @@ resources:
|
||||||
blacklisted_ip_addresses: {get_attr: [BlacklistedIpAddresses, value]}
|
blacklisted_ip_addresses: {get_attr: [BlacklistedIpAddresses, value]}
|
||||||
blacklisted_hostnames: {get_attr: [BlacklistedHostnames, value]}
|
blacklisted_hostnames: {get_attr: [BlacklistedHostnames, value]}
|
||||||
ssh_known_hosts_hostnames: {get_attr: [SshKnownHostsHostnames, value]}
|
ssh_known_hosts_hostnames: {get_attr: [SshKnownHostsHostnames, value]}
|
||||||
|
{% for role in roles %}
|
||||||
|
{{role.name}}Count: {get_param: {{role.name}}Count}
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
ServerOsCollectConfigData:
|
ServerOsCollectConfigData:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
|
|
Loading…
Reference in New Issue