diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/deploy-steps.j2 | 22 | ||||
-rw-r--r-- | common/major_upgrade_steps.j2.yaml | 37 | ||||
-rw-r--r-- | common/services.yaml | 17 |
3 files changed, 63 insertions, 13 deletions
diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index 2b004af1..a1bd8826 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -4,6 +4,9 @@ # On upgrade certain roles can be disabled for operator driven upgrades # See major_upgrade_steps.j2.yaml and post-upgrade.j2.yaml {%- set enabled_roles = roles -%} + {%- set is_upgrade = false -%} +{%- else %} + {%- set is_upgrade = true -%} {%- endif -%} {%- set primary_role = [enabled_roles[0]] -%} {%- for role in enabled_roles -%} @@ -63,7 +66,7 @@ conditions: {%- for role in enabled_roles %} - not: equals: - - get_param: [role_data, {{role.name}}, service_workflow_tasks, step{{step}}] + - get_param: [role_data, {{role.name}}, workflow_tasks, step{{step}}] - '' - False {%- endfor %} @@ -95,7 +98,7 @@ resources: _TASKS: {get_file: deploy-steps-tasks.yaml} {%- for step in range(1, deploy_steps_max) %} -# BEGIN service_workflow_tasks handling +# BEGIN workflow_tasks handling WorkflowTasks_Step{{step}}: type: OS::Mistral::Workflow condition: WorkflowTasks_Step{{step}}_Enabled @@ -111,14 +114,14 @@ resources: {%- endfor %} {%- endif %} properties: - name: {list_join: [".", ["tripleo", {get_param: stack_name}, "workflowtasks", "step{{step}}"]]} + name: {list_join: [".", ["tripleo", {get_param: stack_name}, "workflow_tasks", "step{{step}}"]]} type: direct tasks: yaql: expression: $.data.where($ != '').select($.get('step{{step}}')).where($ != null).flatten() data: {%- for role in enabled_roles %} - - get_param: [role_data, {{role.name}}, service_workflow_tasks] + - get_param: [role_data, {{role.name}}, workflow_tasks] {%- endfor %} WorkflowTasks_Step{{step}}_Execution: @@ -148,7 +151,7 @@ resources: {%- endfor %} evaluate_env: false always_update: true -# END service_workflow_tasks handling +# END workflow_tasks handling {% endfor %} # Artifacts config and HostPrepConfig is done on all roles, not only @@ -189,7 +192,11 @@ resources: tasks: # Join host_prep_tasks with the other per-host configuration list_concat: +{%- if is_upgrade|default(false) and role.disable_upgrade_deployment|default(false) %} + - [] +{%- else %} - {get_param: [role_data, {{role.name}}, host_prep_tasks]} +{%- endif %} - {%- raw %} # Write the manifest for baremetal puppet configuration @@ -363,8 +370,3 @@ outputs: with_sequence: start=0 end={{upgrade_steps_max-1}} loop_control: loop_var: step - - include: deploy_steps_tasks.yaml - with_sequence: start=0 end={{deploy_steps_max-1}} - loop_control: - loop_var: step - diff --git a/common/major_upgrade_steps.j2.yaml b/common/major_upgrade_steps.j2.yaml index 5eb93d39..36b342f9 100644 --- a/common/major_upgrade_steps.j2.yaml +++ b/common/major_upgrade_steps.j2.yaml @@ -187,6 +187,43 @@ resources: role_data: {get_param: role_data} ctlplane_service_ips: {get_param: ctlplane_service_ips} +{%- for step in range(0, upgrade_steps_max) %} + {%- for role in roles %} + {{role.name}}PostUpgradeConfig_Config{{step}}: + type: OS::TripleO::UpgradeConfig + depends_on: + {%- for role_inside in enabled_roles %} + {%- if step > 0 %} + - {{role_inside.name}}PostUpgradeConfig_Deployment{{step -1}} + {%- else %} + - AllNodesPostUpgradeSteps + {%- endif %} + {%- endfor %} + properties: + UpgradeStepConfig: {get_param: [role_data, {{role.name}}, post_upgrade_tasks]} + step: {{step}} + {%- endfor %} + + {%- for role in enabled_roles %} + {{role.name}}PostUpgradeConfig_Deployment{{step}}: + type: OS::Heat::SoftwareDeploymentGroup + depends_on: + {%- for role_inside in enabled_roles %} + {%- if step > 0 %} + - {{role_inside.name}}PostUpgradeConfig_Deployment{{step -1}} + {%- else %} + - AllNodesPostUpgradeSteps + {%- endif %} + {%- endfor %} + properties: + servers: {get_param: [servers, {{role.name}}]} + config: {get_resource: {{role.name}}PostUpgradeConfig_Config{{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) diff --git a/common/services.yaml b/common/services.yaml index a8186e43..a0015c7e 100644 --- a/common/services.yaml +++ b/common/services.yaml @@ -174,13 +174,13 @@ resources: expression: coalesce($.data.role_data, []).where($ != null).select($.get('service_config_settings')).where($ != null).reduce($1.mergeWith($2), {}) data: {role_data: {get_attr: [ServiceChain, role_data]}} - ServiceWorkflowTasks: + WorkflowTasks: type: OS::Heat::Value properties: type: json value: yaql: - expression: coalesce($.data.role_data, []).where($ != null).select($.get('service_workflow_tasks')).where($ != null).reduce($1.mergeWith($2), {}) + expression: coalesce($.data.role_data, []).where($ != null).select($.get('workflow_tasks')).where($ != null).reduce($1.mergeWith($2), {}) data: {role_data: {get_attr: [ServiceChain, role_data]}} UpgradeTasks: @@ -193,6 +193,16 @@ resources: expression: coalesce($.data, []).where($ != null).select($.get('upgrade_tasks')).where($ != null).flatten().distinct() data: {get_attr: [ServiceChain, role_data]} + PostUpgradeTasks: + type: OS::Heat::Value + properties: + type: comma_delimited_list + value: + yaql: + # Note we use distinct() here to filter any identical tasks, e.g yum update for all services + expression: coalesce($.data, []).where($ != null).select($.get('post_upgrade_tasks')).where($ != null).flatten().distinct() + data: {get_attr: [ServiceChain, role_data]} + UpdateTasks: type: OS::Heat::Value properties: @@ -260,9 +270,10 @@ outputs: config_settings: {map_merge: {get_attr: [ServiceChain, role_data, config_settings]}} global_config_settings: {get_attr: [GlobalConfigSettings, value]} service_config_settings: {get_attr: [ServiceConfigSettings, value]} - service_workflow_tasks: {get_attr: [ServiceWorkflowTasks, value]} + workflow_tasks: {get_attr: [WorkflowTasks, value]} step_config: {get_attr: [PuppetStepConfig, value]} upgrade_tasks: {get_attr: [UpgradeTasks, value]} + post_upgrade_tasks: {get_attr: [PostUpgradeTasks, value]} update_tasks: {get_attr: [UpdateTasks, value]} upgrade_batch_tasks: {get_attr: [UpgradeBatchTasks, value]} service_metadata_settings: {get_attr: [ServiceServerMetadataHook, metadata]} |