1 {% set upgrade_steps_max = 8 -%}
2 heat_template_version: ocata
3 description: 'Upgrade steps for all roles'
11 description: Mapping of Role name e.g Controller to the per-role data
16 Setting to a previously unused value during stack-update will trigger
17 the Upgrade resources to re-run on all roles.
20 # Conditions to disable any steps where the task list is empty
21 {% for step in range(0, upgrade_steps_max) %}
22 {% for role in roles %}
23 UpgradeBatchConfig_Step{{step}}Enabled:
26 - {get_param: [role_data, {{role.name}}, upgrade_batch_tasks]}
28 UpgradeConfig_Step{{step}}Enabled:
31 - {get_param: [role_data, {{role.name}}, upgrade_tasks]}
38 # Upgrade Steps for all roles, batched updates
39 # FIXME(shardy): would be nice to make the number of steps configurable
40 {% for step in range(0, upgrade_steps_max) %}
41 {% for role in roles %}
42 # Step {{step}} resources
43 {{role.name}}UpgradeBatchConfig_Step{{step}}:
44 type: OS::TripleO::UpgradeConfig
45 condition: UpgradeBatchConfig_Step{{step}}Enabled
46 # The UpgradeConfig resources could actually be created without
47 # serialization, but the event output is easier to follow if we
48 # do, and there should be minimal performance hit (creating the
49 # config is cheap compared to the time to apply the deployment).
52 {% for dep in roles %}
53 - {{dep.name}}UpgradeBatch_Step{{step -1}}
57 UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_batch_tasks]}
60 {{role.name}}UpgradeBatch_Step{{step}}:
61 type: OS::Heat::StructuredDeploymentGroup
62 condition: UpgradeBatchConfig_Step{{step}}Enabled
65 {% for dep in roles %}
66 - {{dep.name}}UpgradeBatch_Step{{step -1}}
71 max_batch_size: {{role.upgrade_batch_size|default(1)}}
73 max_batch_size: {{role.upgrade_batch_size|default(1)}}
75 name: {{role.name}}UpgradeBatch_Step{{step}}
76 servers: {get_param: [servers, {{role.name}}]}
77 config: {get_resource: {{role.name}}UpgradeBatchConfig_Step{{step}}}
80 update_identifier: {get_param: UpdateIdentifier}
84 # Upgrade Steps for all roles
85 # FIXME(shardy): would be nice to make the number of steps configurable
86 {% for step in range(0, upgrade_steps_max) %}
87 {% for role in roles %}
88 # Step {{step}} resources
89 {{role.name}}UpgradeConfig_Step{{step}}:
90 type: OS::TripleO::UpgradeConfig
91 condition: UpgradeConfig_Step{{step}}Enabled
92 # The UpgradeConfig resources could actually be created without
93 # serialization, but the event output is easier to follow if we
94 # do, and there should be minimal performance hit (creating the
95 # config is cheap compared to the time to apply the deployment).
98 {% for dep in roles %}
99 {% if not dep.disable_upgrade_deployment|default(false) %}
100 - {{dep.name}}Upgrade_Step{{step -1}}
104 {% for dep in roles %}
105 - {{dep.name}}UpgradeBatch_Step{{upgrade_steps_max -1}}
109 UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_tasks]}
111 {% if not role.disable_upgrade_deployment|default(false) %}
112 {{role.name}}Upgrade_Step{{step}}:
113 type: OS::Heat::StructuredDeploymentGroup
114 condition: UpgradeConfig_Step{{step}}Enabled
117 {% for dep in roles %}
118 {% if not dep.disable_upgrade_deployment|default(false) %}
119 - {{dep.name}}Upgrade_Step{{step -1}}
123 {% for dep in roles %}
124 - {{dep.name}}UpgradeBatch_Step{{upgrade_steps_max -1}}
128 name: {{role.name}}Upgrade_Step{{step}}
129 servers: {get_param: [servers, {{role.name}}]}
130 config: {get_resource: {{role.name}}UpgradeConfig_Step{{step}}}
133 update_identifier: {get_param: UpdateIdentifier}
139 # Output the config for each role, just use Step1 as the config should be
140 # the same for all steps (only the tag provided differs)
142 description: The per-role upgrade configuration used
144 {% for role in roles %}
145 {{role.name.lower()}}: {get_attr: [{{role.name}}UpgradeConfig_Step1, upgrade_config]}