Merge "Add pre_upgrade_rolling_tasks"

This commit is contained in:
Zuul 2018-03-21 19:33:58 +00:00 committed by Gerrit Code Review
commit 0901d8ee5f
4 changed files with 48 additions and 0 deletions

View File

@ -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

View File

@ -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]}

View File

@ -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.

View File

@ -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',