aboutsummaryrefslogtreecommitdiffstats
path: root/puppet
diff options
context:
space:
mode:
authorMathieu Bultel <mbultel@redhat.com>2017-02-07 17:46:34 +0100
committermathieu bultel <mat.bultel@gmail.com>2017-02-10 06:58:41 +0000
commit9df292885088b36f27ad65e16fe1d63198a5fe7d (patch)
tree538e4850def0c31f80df7209aeaf3840eb357307 /puppet
parentb49b443ea75c80a67fcc0999d2d31b8bd6bc1c8f (diff)
Make UpgradeBatch resource depends on BatchConfig step0
Make UpgradeBatch depends on BatchConfig, for step0 avoid creation of the UpgradeBatchConfig_stepX prior to UpgradeBatchConfig step0 and add condition Change-Id: I852beee65590270422cfbc9abe02111d88442f2e
Diffstat (limited to 'puppet')
-rw-r--r--puppet/major_upgrade_steps.j2.yaml44
1 files changed, 18 insertions, 26 deletions
diff --git a/puppet/major_upgrade_steps.j2.yaml b/puppet/major_upgrade_steps.j2.yaml
index b879fafa..aa19dcb8 100644
--- a/puppet/major_upgrade_steps.j2.yaml
+++ b/puppet/major_upgrade_steps.j2.yaml
@@ -46,10 +46,11 @@ resources:
{{role.name}}UpgradeBatchConfig_Step{{step}}:
type: OS::TripleO::UpgradeConfig
{%- if step > 0 %}
+ condition: {{role.name}}UpgradeBatchConfigEnabled
+ {% if role.name in enabled_roles %}
depends_on:
- {%- for dep in enabled_roles %}
- - {{dep.name}}UpgradeBatch_Step{{step -1}}
- {%- endfor %}
+ - {{role.name}}UpgradeBatch_Step{{step -1}}
+ {% endif %}
{%- endif %}
properties:
UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_batch_tasks]}
@@ -61,12 +62,13 @@ resources:
{{role.name}}UpgradeBatch_Step{{step}}:
type: OS::Heat::SoftwareDeploymentGroup
condition: {{role.name}}UpgradeBatchConfigEnabled
- {%- if step > 0 %}
+ {%- if step > 0 %}
depends_on:
- {%- for dep in enabled_roles %}
- - {{dep.name}}UpgradeBatch_Step{{step -1}}
- {%- endfor %}
- {%- endif %}
+ - {{role.name}}UpgradeBatch_Step{{step -1}}
+ {% else %}
+ depends_on:
+ - {{role.name}}UpgradeBatchConfig_Step{{step}}
+ {%- endif %}
update_policy:
batch_create:
max_batch_size: {{role.upgrade_batch_size|default(1)}}
@@ -92,15 +94,12 @@ resources:
# serialization, but the event output is easier to follow if we
# do, and there should be minimal performance hit (creating the
# config is cheap compared to the time to apply the deployment).
- depends_on:
{%- if step > 0 %}
- {%- for dep in enabled_roles %}
- - {{dep.name}}Upgrade_Step{{step -1}}
- {%- endfor %}
- {%- else %}
- {%- for dep in enabled_roles %}
- - {{dep.name}}UpgradeBatch_Step{{batch_upgrade_steps_max -1}}
- {%- endfor %}
+ condition: {{role.name}}UpgradeConfigEnabled
+ {% if role.name in enabled_roles %}
+ depends_on:
+ - {{role.name}}Upgrade_Step{{step -1}}
+ {% endif %}
{%- endif %}
properties:
UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_tasks]}
@@ -111,17 +110,11 @@ resources:
{%- for role in enabled_roles %}
{{role.name}}Upgrade_Step{{step}}:
type: OS::Heat::SoftwareDeploymentGroup
+ {%- if step > 0 %}
condition: {{role.name}}UpgradeConfigEnabled
depends_on:
- {%- if step > 0 %}
- {%- for dep in enabled_roles %}
- - {{dep.name}}Upgrade_Step{{step -1}}
- {%- endfor %}
- {%- else %}
- {%- for dep in enabled_roles %}
- - {{dep.name}}UpgradeBatch_Step{{batch_upgrade_steps_max -1}}
- {%- endfor %}
- {%- endif %}
+ - {{role.name}}Upgrade_Step{{step -1}}
+ {%- endif %}
properties:
name: {{role.name}}Upgrade_Step{{step}}
servers: {get_param: [servers, {{role.name}}]}
@@ -154,4 +147,3 @@ outputs:
{% for role in roles %}
{{role.name.lower()}}: {get_attr: [{{role.name}}UpgradeConfig_Step1, upgrade_config]}
{% endfor %}
-