From 9df292885088b36f27ad65e16fe1d63198a5fe7d Mon Sep 17 00:00:00 2001 From: Mathieu Bultel Date: Tue, 7 Feb 2017 17:46:34 +0100 Subject: 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 --- puppet/major_upgrade_steps.j2.yaml | 44 ++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 26 deletions(-) (limited to 'puppet/major_upgrade_steps.j2.yaml') 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 %} - -- cgit 1.2.3-korg