Merge "ffu: Add fast-forward upgrade outputs to RoleConfig"

This commit is contained in:
Zuul 2018-02-12 19:39:14 +00:00 committed by Gerrit Code Review
commit e9b0c28b81
4 changed files with 84 additions and 0 deletions

@ -21,6 +21,8 @@
{% set update_steps_max = 6 -%}
{% set upgrade_steps_max = 6 -%}
{% set post_upgrade_steps_max = 4 -%}
{% set fast_forward_upgrade_steps_max = 9 -%}
{% set fast_forward_upgrade_prep_steps_max = 3 -%}
heat_template_version: queens
@ -71,6 +73,10 @@ parameters:
description: List of hostnames belong to blacklisted servers
type: comma_delimited_list
default: []
FastForwardUpgradeReleases:
type: comma_delimited_list
default: ['ocata', 'pike']
description: List of releases to fast forward through during upgrade.
conditions:
{% for step in range(1, deploy_steps_max) %}
@ -553,3 +559,34 @@ outputs:
with_sequence: start=0 end={{post_upgrade_steps_max-1}}
loop_control:
loop_var: step
fast_forward_upgrade_playbook:
- hosts: overcloud
become: true
tasks:
- include_tasks: fast_forward_upgrade_release_tasks.yaml
loop_control:
loop_var: release
with_items: {get_param: [FastForwardUpgradeReleases]}
fast_forward_upgrade_release_tasks: |
- include_tasks: fast_forward_upgrade_prep_tasks.yaml
- include_tasks: fast_forward_upgrade_bootstrap_tasks.yaml
fast_forward_upgrade_prep_tasks: |
- include_tasks: fast_forward_upgrade_prep_role_tasks.yaml
with_sequence: start=0 end={{fast_forward_upgrade_prep_steps_max}}
loop_control:
loop_var: step
fast_forward_upgrade_prep_role_tasks: |
{%- for role in roles %}
- include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
when: role_name == '{{role.name}}'
{%- endfor %}
fast_forward_upgrade_bootstrap_tasks: |
- include_tasks: fast_forward_upgrade_bootstrap_role_tasks.yaml
with_sequence: start={{fast_forward_upgrade_prep_steps_max+1}} end={{fast_forward_upgrade_steps_max}}
loop_control:
loop_var: step
fast_forward_upgrade_bootstrap_role_tasks: |
{%- for role in roles %}
- include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
when: role_name == '{{role.name}}' and ansible_hostname == {{role.name}}[0]
{%- endfor %}

@ -244,6 +244,15 @@ resources:
expression: coalesce($.data, []).where($ != null).select($.get('external_post_deploy_tasks')).where($ != null).flatten().distinct()
data: {get_attr: [ServiceChain, role_data]}
FastForwardUpgradeTasks:
type: OS::Heat::Value
properties:
type: comma_delimited_list
value:
yaql:
expression: coalesce($.data, []).where($ != null).select($.get('fast_forward_upgrade_tasks')).where($ != null).flatten().distinct()
data: {get_attr: [ServiceChain, role_data]}
UpgradeTasks:
type: OS::Heat::Value
properties:
@ -336,6 +345,7 @@ outputs:
deploy_steps_tasks: {get_attr: [DeployStepsTasks, value]}
external_deploy_tasks: {get_attr: [ExternalDeployTasks, value]}
external_post_deploy_tasks: {get_attr: [ExternalPostDeployTasks, value]}
fast_forward_upgrade_tasks: {get_attr: [FastForwardUpgradeTasks, value]}
upgrade_tasks: {get_attr: [UpgradeTasks, value]}
post_upgrade_tasks: {get_attr: [PostUpgradeTasks, value]}
update_tasks: {get_attr: [UpdateTasks, value]}

@ -140,3 +140,32 @@ all containerized services and the updated configuration if any.
Note: as pacemaker is not containerized, the points 1 and 4 happen in
puppet/services/pacemaker.yaml.
Fast-forward Upgrade Steps
--------------------------
Each service template may optionally define a `fast_forward_upgrade_tasks` key,
which is a list of Ansible tasks to be performed during the fast-forward
upgrade process. As with Upgrade steps each task is associated to a particular
step provided as a variable and used along with a release variable by a basic
conditional that determines when the task should run.
Steps are broken down into two categories, prep tasks executed across all hosts
and bootstrap tasks executed on a single host for a given role.
The individual steps then correspond to the following tasks during the upgrade:
Prep steps:
- Step=1: Stop the cluster
- Step=2: Stop the service
- Step=3: Update repos
Bootstrap steps:
- Step=4: DB backups
- Step=5: Pre package update commands
- Step=6: Package updates
- Step=7: Post package update commands
- Step=8: DB syncs
- Step=9: Verification

@ -0,0 +1,8 @@
---
upgrade:
- |
Each service template may optionally define a `fast_forward_upgrade_tasks`
key, which is a list of ansible tasks to be performed during the
fast-forward upgrade process. As with Upgrade steps each task is associated
to a particular step provided as a variable and used along with a release
variable by a basic conditional that determines when the task should run.