Merge "Set manila cephfs backend if ceph is deployed"
[apex-tripleo-heat-templates.git] / puppet / major_upgrade_steps.j2.yaml
1 heat_template_version: ocata
2 description: 'Upgrade steps for all roles'
3
4 parameters:
5   servers:
6     type: json
7
8   role_data:
9     type: json
10     description: Mapping of Role name e.g Controller to the per-role data
11
12   UpdateIdentifier:
13     type: string
14     description: >
15       Setting to a previously unused value during stack-update will trigger
16       the Upgrade resources to re-run on all roles.
17
18 resources:
19
20 # Upgrade Steps for all roles
21 # FIXME(shardy): would be nice to make the number of steps configurable
22 {% for step in range(0, 8) %}
23   {% for role in roles %}
24   # Step {{step}} resources
25   {{role.name}}UpgradeConfig_Step{{step}}:
26     type: OS::TripleO::UpgradeConfig
27   # The UpgradeConfig resources could actually be created without
28   # serialization, but the event output is easier to follow if we
29   # do, and there should be minimal performance hit (creating the
30   # config is cheap compared to the time to apply the deployment).
31   {% if step > 0 %}
32     depends_on:
33       {% for dep in roles %}
34       - {{dep.name}}Upgrade_Step{{step -1}}
35       {% endfor %}
36   {% endif %}
37     properties:
38       UpgradeStepConfig: {get_param: [role_data, {{role.name}}, upgrade_tasks]}
39       step: {{step}}
40
41   {{role.name}}Upgrade_Step{{step}}:
42     type: OS::Heat::StructuredDeploymentGroup
43   {% if step > 0 %}
44     depends_on:
45       {% for dep in roles %}
46       - {{dep.name}}Upgrade_Step{{step -1}}
47       {% endfor %}
48   {% endif %}
49     properties:
50       name: {{role.name}}Upgrade_Step{{step}}
51       servers: {get_param: [servers, {{role.name}}]}
52       config: {get_resource: {{role.name}}UpgradeConfig_Step{{step}}}
53       input_values:
54         role: {{role.name}}
55         update_identifier: {get_param: UpdateIdentifier}
56   {% endfor %}
57 {% endfor %}
58
59 outputs:
60   # Output the config for each role, just use Step1 as the config should be
61   # the same for all steps (only the tag provided differs)
62   upgrade_configs:
63     description: The per-role upgrade configuration used
64     value:
65 {% for role in roles %}
66       {{role.name.lower()}}: {get_attr: [{{role.name}}UpgradeConfig_Step1, upgrade_config]}
67 {% endfor %}
68