Merge "FFU: Introduce post FFU steps and use them for qeens switch"
This commit is contained in:
commit
e3a0b6bb2a
@ -76,8 +76,8 @@ parameters:
|
|||||||
default: []
|
default: []
|
||||||
FastForwardUpgradeReleases:
|
FastForwardUpgradeReleases:
|
||||||
type: comma_delimited_list
|
type: comma_delimited_list
|
||||||
default: ['ocata', 'pike']
|
default: ['ocata', 'pike', 'queens']
|
||||||
description: List of releases to fast forward through during upgrade.
|
description: List of releases to fast forward through during upgrade. Last release in list is used for post steps.
|
||||||
|
|
||||||
conditions:
|
conditions:
|
||||||
{% for step in range(1, deploy_steps_max) %}
|
{% for step in range(1, deploy_steps_max) %}
|
||||||
@ -565,10 +565,20 @@ outputs:
|
|||||||
- hosts: overcloud
|
- hosts: overcloud
|
||||||
become: true
|
become: true
|
||||||
tasks:
|
tasks:
|
||||||
|
- set_fact:
|
||||||
|
releases: {get_param: [FastForwardUpgradeReleases]}
|
||||||
|
{% raw %}
|
||||||
|
- set_fact:
|
||||||
|
ffu_releases: "{{ releases | difference( releases | last )}}"
|
||||||
- include_tasks: fast_forward_upgrade_release_tasks.yaml
|
- include_tasks: fast_forward_upgrade_release_tasks.yaml
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: release
|
loop_var: release
|
||||||
with_items: {get_param: [FastForwardUpgradeReleases]}
|
with_items: '{{ ffu_releases }}'
|
||||||
|
- set_fact:
|
||||||
|
release: "{{ releases | last }}"
|
||||||
|
ffu_packages_apply: True
|
||||||
|
{% endraw %}
|
||||||
|
- include_tasks: fast_forward_upgrade_post_role_tasks.yaml
|
||||||
fast_forward_upgrade_release_tasks: |
|
fast_forward_upgrade_release_tasks: |
|
||||||
- include_tasks: fast_forward_upgrade_prep_tasks.yaml
|
- include_tasks: fast_forward_upgrade_prep_tasks.yaml
|
||||||
- include_tasks: fast_forward_upgrade_bootstrap_tasks.yaml
|
- include_tasks: fast_forward_upgrade_bootstrap_tasks.yaml
|
||||||
@ -593,9 +603,11 @@ outputs:
|
|||||||
tags: common
|
tags: common
|
||||||
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
command: hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid
|
||||||
register: bootstrap_node
|
register: bootstrap_node
|
||||||
- name: set is_bootstrap_node fact
|
- name: set is_bootstrap_node ffu_packages_bootstrap_only facts
|
||||||
tags: common
|
tags: common
|
||||||
set_fact: is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
set_fact:
|
||||||
|
is_bootstrap_node={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||||
|
ffu_packages_apply={{bootstrap_node.stdout|lower == ansible_hostname|lower}}
|
||||||
{% endraw %}
|
{% endraw %}
|
||||||
- name: Create /var/lib/docker-puppet
|
- name: Create /var/lib/docker-puppet
|
||||||
file: path=/var/lib/docker-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true
|
file: path=/var/lib/docker-puppet state=directory setype=svirt_sandbox_file_t selevel=s0 recurse=true
|
||||||
@ -605,6 +617,17 @@ outputs:
|
|||||||
with_sequence: start=0 end={{fast_forward_upgrade_prep_steps_max}}
|
with_sequence: start=0 end={{fast_forward_upgrade_prep_steps_max}}
|
||||||
loop_control:
|
loop_control:
|
||||||
loop_var: step
|
loop_var: step
|
||||||
|
fast_forward_upgrade_post_role_tasks: |
|
||||||
|
{%- for role in roles %}
|
||||||
|
- include_tasks: {{role.name}}/fast_forward_post_upgrade_tasks.yaml
|
||||||
|
when: role_name == '{{role.name}}'
|
||||||
|
{%- endfor %}
|
||||||
|
- name: Openstack Heat Agents package update
|
||||||
|
yum: name=openstack-heat-agents state=latest
|
||||||
|
- name: Update os-collect-config
|
||||||
|
yum: name=os-collect-config state=latest
|
||||||
|
- name: Start os-collect-config back up
|
||||||
|
service: name=os-collect-config state=started enabled=yes
|
||||||
fast_forward_upgrade_prep_role_tasks: |
|
fast_forward_upgrade_prep_role_tasks: |
|
||||||
{%- for role in roles %}
|
{%- for role in roles %}
|
||||||
- include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
|
- include_tasks: {{role.name}}/fast_forward_upgrade_tasks.yaml
|
||||||
|
@ -253,6 +253,15 @@ resources:
|
|||||||
expression: coalesce($.data, []).where($ != null).select($.get('fast_forward_upgrade_tasks')).where($ != null).flatten().distinct()
|
expression: coalesce($.data, []).where($ != null).select($.get('fast_forward_upgrade_tasks')).where($ != null).flatten().distinct()
|
||||||
data: {get_attr: [ServiceChain, role_data]}
|
data: {get_attr: [ServiceChain, role_data]}
|
||||||
|
|
||||||
|
FastForwardPostUpgradeTasks:
|
||||||
|
type: OS::Heat::Value
|
||||||
|
properties:
|
||||||
|
type: comma_delimited_list
|
||||||
|
value:
|
||||||
|
yaql:
|
||||||
|
expression: coalesce($.data, []).where($ != null).select($.get('fast_forward_post_upgrade_tasks')).where($ != null).flatten().distinct()
|
||||||
|
data: {get_attr: [ServiceChain, role_data]}
|
||||||
|
|
||||||
UpgradeTasks:
|
UpgradeTasks:
|
||||||
type: OS::Heat::Value
|
type: OS::Heat::Value
|
||||||
properties:
|
properties:
|
||||||
@ -356,6 +365,7 @@ outputs:
|
|||||||
external_deploy_tasks: {get_attr: [ExternalDeployTasks, value]}
|
external_deploy_tasks: {get_attr: [ExternalDeployTasks, value]}
|
||||||
external_post_deploy_tasks: {get_attr: [ExternalPostDeployTasks, value]}
|
external_post_deploy_tasks: {get_attr: [ExternalPostDeployTasks, value]}
|
||||||
fast_forward_upgrade_tasks: {get_attr: [FastForwardUpgradeTasks, value]}
|
fast_forward_upgrade_tasks: {get_attr: [FastForwardUpgradeTasks, value]}
|
||||||
|
fast_forward_post_upgrade_tasks: {get_attr: [FastForwardPostUpgradeTasks, value]}
|
||||||
upgrade_tasks: {get_attr: [UpgradeTasks, value]}
|
upgrade_tasks: {get_attr: [UpgradeTasks, value]}
|
||||||
post_upgrade_tasks: {get_attr: [PostUpgradeTasks, value]}
|
post_upgrade_tasks: {get_attr: [PostUpgradeTasks, value]}
|
||||||
update_tasks: {get_attr: [UpdateTasks, value]}
|
update_tasks: {get_attr: [UpdateTasks, value]}
|
||||||
|
@ -38,7 +38,7 @@ parameters:
|
|||||||
default: 'tripleo-repos'
|
default: 'tripleo-repos'
|
||||||
type: string
|
type: string
|
||||||
FastForwardRepoArgs:
|
FastForwardRepoArgs:
|
||||||
default: {'tripleo_repos': {'ocata': '-b ocata current', 'pike': '-b pike current'}}
|
default: {'tripleo_repos': {'ocata': '-b ocata current', 'pike': '-b pike current', 'queens': '-b queens current'}}
|
||||||
type: json
|
type: json
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
@ -117,5 +117,26 @@ outputs:
|
|||||||
command: "tripleo-repos {{ fast_forward_repo_args.tripleo_repos[release] }}"
|
command: "tripleo-repos {{ fast_forward_repo_args.tripleo_repos[release] }}"
|
||||||
when:
|
when:
|
||||||
- step|int == 3
|
- step|int == 3
|
||||||
- is_bootstrap_node|bool
|
- ffu_packages_apply|bool
|
||||||
|
- fast_forward_repo_type == 'tripleo-repos'
|
||||||
|
fast_forward_post_upgrade_tasks:
|
||||||
|
- name: Register repo type and args
|
||||||
|
set_fact:
|
||||||
|
fast_forward_repo_type: {get_param: FastForwardRepoType}
|
||||||
|
fast_forward_repo_args: {get_param: FastForwardRepoArgs}
|
||||||
|
- debug:
|
||||||
|
msg: "fast_forward_repo_type: {{ fast_forward_repo_type }} fast_forward_repo_args: {{ fast_forward_repo_args }}"
|
||||||
|
- block:
|
||||||
|
- name: clone tripleo-repos
|
||||||
|
git:
|
||||||
|
repo: https://github.com/openstack/tripleo-repos.git
|
||||||
|
dest: /home/stack/tripleo-repos/
|
||||||
|
- name: install tripleo-repos
|
||||||
|
command: python setup.py install
|
||||||
|
args:
|
||||||
|
chdir: /home/stack/tripleo-repos/
|
||||||
|
- name: Enable tripleo-repos
|
||||||
|
command: "tripleo-repos {{ fast_forward_repo_args.tripleo_repos[release] }}"
|
||||||
|
when:
|
||||||
|
- ffu_packages_apply|bool
|
||||||
- fast_forward_repo_type == 'tripleo-repos'
|
- fast_forward_repo_type == 'tripleo-repos'
|
||||||
|
@ -45,6 +45,7 @@ REQUIRED_DOCKER_SECTIONS = ['service_name', 'docker_config', 'puppet_config',
|
|||||||
'config_settings']
|
'config_settings']
|
||||||
OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks',
|
OPTIONAL_DOCKER_SECTIONS = ['docker_puppet_tasks', 'upgrade_tasks',
|
||||||
'fast_forward_upgrade_tasks',
|
'fast_forward_upgrade_tasks',
|
||||||
|
'fast_forward_post_upgrade_tasks',
|
||||||
'post_upgrade_tasks', 'update_tasks',
|
'post_upgrade_tasks', 'update_tasks',
|
||||||
'post_update_tasks', 'service_config_settings',
|
'post_update_tasks', 'service_config_settings',
|
||||||
'host_prep_tasks', 'metadata_settings',
|
'host_prep_tasks', 'metadata_settings',
|
||||||
@ -524,6 +525,11 @@ def validate_docker_service(filename, tpl):
|
|||||||
print('ERROR: fast_forward_upgrade_tasks validation failed')
|
print('ERROR: fast_forward_upgrade_tasks validation failed')
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
if 'fast_forward_post_upgrade_tasks' in role_data and role_data['fast_forward_post_upgrade_tasks']:
|
||||||
|
if validate_upgrade_tasks(role_data['fast_forward_post_upgrade_tasks']):
|
||||||
|
print('ERROR: fast_forward_post_upgrade_tasks validation failed')
|
||||||
|
return 1
|
||||||
|
|
||||||
if 'parameters' in tpl:
|
if 'parameters' in tpl:
|
||||||
for param in required_params:
|
for param in required_params:
|
||||||
if param not in tpl['parameters']:
|
if param not in tpl['parameters']:
|
||||||
@ -581,6 +587,11 @@ def validate_service(filename, tpl):
|
|||||||
print('ERROR: fast_forward_upgrade_tasks validation failed')
|
print('ERROR: fast_forward_upgrade_tasks validation failed')
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
if 'fast_forward_post_upgrade_tasks' in role_data and role_data['fast_forward_post_upgrade_tasks']:
|
||||||
|
if validate_upgrade_tasks(role_data['fast_forward_post_upgrade_tasks']):
|
||||||
|
print('ERROR: fast_forward_post_upgrade_tasks validation failed')
|
||||||
|
return 1
|
||||||
|
|
||||||
if 'parameters' in tpl:
|
if 'parameters' in tpl:
|
||||||
for param in required_params:
|
for param in required_params:
|
||||||
if param not in tpl['parameters']:
|
if param not in tpl['parameters']:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user