diff --git a/common/deploy-steps.j2 b/common/deploy-steps.j2 index f0edd29af6..832795a932 100644 --- a/common/deploy-steps.j2 +++ b/common/deploy-steps.j2 @@ -19,6 +19,7 @@ # primary role is: {{primary_role_name}} {% set deploy_steps_max = 6 -%} {% set update_steps_max = 6 -%} +{% set pre_upgrade_rolling_steps_max = 1 -%} {% set upgrade_steps_max = 6 -%} {% set post_upgrade_steps_max = 4 -%} {% set fast_forward_upgrade_steps_max = 9 -%} @@ -537,6 +538,33 @@ outputs: with_sequence: start=1 end={{deploy_steps_max-1}} loop_control: loop_var: step + pre_upgrade_rolling_steps_tasks: | +{%- for role in roles %} + - include: {{role.name}}/pre_upgrade_rolling_tasks.yaml + when: role_name == '{{role.name}}' +{%- endfor %} + pre_upgrade_rolling_steps_playbook: | + - hosts: undercloud + name: Gather facts undercloud + gather_facts: yes + become: false + - hosts: overcloud + name: Gather facts overcloud + gather_facts: yes + - hosts: all + name: Load global variables + gather_facts: no + tasks: + - include_vars: global_vars.yaml + - hosts: overcloud + name: Run pre-upgrade rolling tasks + serial: 1 + gather_facts: no + tasks: + - include: pre_upgrade_rolling_steps_tasks.yaml + with_sequence: start=0 end={{pre_upgrade_rolling_steps_max-1}} + loop_control: + loop_var: step upgrade_steps_tasks: | {%- for role in roles %} - include: {{role.name}}/upgrade_tasks.yaml diff --git a/common/services.yaml b/common/services.yaml index 97e22ee5ac..2bfab14cc6 100644 --- a/common/services.yaml +++ b/common/services.yaml @@ -262,6 +262,15 @@ resources: expression: coalesce($.data, []).where($ != null).select($.get('fast_forward_post_upgrade_tasks')).where($ != null).flatten().distinct() data: {get_attr: [ServiceChain, role_data]} + PreUpgradeRollingTasks: + type: OS::Heat::Value + properties: + type: comma_delimited_list + value: + yaql: + expression: coalesce($.data, []).where($ != null).select($.get('pre_upgrade_rolling_tasks')).where($ != null).flatten().distinct() + data: {get_attr: [ServiceChain, role_data]} + UpgradeTasks: type: OS::Heat::Value properties: @@ -366,6 +375,7 @@ outputs: external_post_deploy_tasks: {get_attr: [ExternalPostDeployTasks, value]} fast_forward_upgrade_tasks: {get_attr: [FastForwardUpgradeTasks, value]} fast_forward_post_upgrade_tasks: {get_attr: [FastForwardPostUpgradeTasks, value]} + pre_upgrade_rolling_tasks: {get_attr: [PreUpgradeRollingTasks, value]} upgrade_tasks: {get_attr: [UpgradeTasks, value]} post_upgrade_tasks: {get_attr: [PostUpgradeTasks, value]} update_tasks: {get_attr: [UpdateTasks, value]} diff --git a/releasenotes/notes/pre_upgrade_rolling_tasks-6345e98e8283a907.yaml b/releasenotes/notes/pre_upgrade_rolling_tasks-6345e98e8283a907.yaml new file mode 100644 index 0000000000..de9387c46a --- /dev/null +++ b/releasenotes/notes/pre_upgrade_rolling_tasks-6345e98e8283a907.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + pre_upgrade_rolling_tasks are added for use by the composable + service templates. The resulting + pre_upgrade_rolling_steps_playbook is intended to be run at the + beginning of major update workflow (before running the + upgrade_steps_playbook). As the name suggests, the tasks in this + playbook will be executed in a node-by-node rolling fashion. diff --git a/tools/yaml-validate.py b/tools/yaml-validate.py index d7d0d87af2..9c83e0bc74 100755 --- a/tools/yaml-validate.py +++ b/tools/yaml-validate.py @@ -44,6 +44,7 @@ OPTIONAL_SECTIONS = ['workflow_tasks', 'cellv2_discovery'] REQUIRED_DOCKER_SECTIONS = ['service_name', 'docker_config', 'puppet_config', 'config_settings'] OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks', + 'pre_upgrade_rolling_tasks', 'fast_forward_upgrade_tasks', 'fast_forward_post_upgrade_tasks', 'post_upgrade_tasks', 'update_tasks',