c568891000
We can't run this during the upgrade steps, because there are things which need to happen before any role configuration happens, e.g installing the new hiera heat-config hook, which must be done before e.g "ControllerDeployment" runs or the stack update hangs. Partially-Implements: blueprint overcloud-upgrades-per-service Change-Id: I365b57513590662c3f78a33dc625747f457c48c5
69 lines
2.1 KiB
YAML
69 lines
2.1 KiB
YAML
heat_template_version: 2016-10-14
|
|
description: 'Upgrade steps for all roles'
|
|
|
|
parameters:
|
|
servers:
|
|
type: json
|
|
|
|
role_data:
|
|
type: json
|
|
description: Mapping of Role name e.g Controller to the per-role data
|
|
|
|
UpdateIdentifier:
|
|
type: string
|
|
description: >
|
|
Setting to a previously unused value during stack-update will trigger
|
|
the Upgrade resources to re-run on all roles.
|
|
|
|
resources:
|
|
|
|
# Upgrade Steps for all roles
|
|
# FIXME(shardy): would be nice to make the number of steps configurable
|
|
{% for step in range(1, 8) %}
|
|
{% for role in roles %}
|
|
# Step {{step}} resources
|
|
{{role.name}}UpgradeConfig_Step{{step}}:
|
|
type: OS::TripleO::UpgradeConfig
|
|
# The UpgradeConfig resources could actually be created without
|
|
# 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).
|
|
{% if step > 1 %}
|
|
depends_on:
|
|
{% for dep in roles %}
|
|
- {{dep.name}}Upgrade_Step{{step -1}}
|
|
{% endfor %}
|
|
{% endif %}
|
|
properties:
|
|
UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_tasks]}
|
|
step: {{step}}
|
|
|
|
{{role.name}}Upgrade_Step{{step}}:
|
|
type: OS::Heat::StructuredDeploymentGroup
|
|
{% if step > 1 %}
|
|
depends_on:
|
|
{% for dep in roles %}
|
|
- {{dep.name}}Upgrade_Step{{step -1}}
|
|
{% endfor %}
|
|
{% endif %}
|
|
properties:
|
|
name: {{role.name}}Upgrade_Step{{step}}
|
|
servers: {get_param: [servers, {{role.name}}]}
|
|
config: {get_resource: {{role.name}}UpgradeConfig_Step{{step}}}
|
|
input_values:
|
|
role: {{role.name}}
|
|
update_identifier: {get_param: UpdateIdentifier}
|
|
{% endfor %}
|
|
{% endfor %}
|
|
|
|
outputs:
|
|
# Output the config for each role, just use Step1 as the config should be
|
|
# the same for all steps (only the tag provided differs)
|
|
upgrade_configs:
|
|
description: The per-role upgrade configuration used
|
|
value:
|
|
{% for role in roles %}
|
|
{{role.name.lower()}}: {get_attr: [{{role.name}}UpgradeConfig_Step1, upgrade_config]}
|
|
{% endfor %}
|
|
|