367 lines
13 KiB
YAML
367 lines
13 KiB
YAML
---
|
|
- name: create Undercloud ffu prepare scripts
|
|
include_tasks: create-undercloud-ffu-scripts.yaml
|
|
tags: create_ffu_prepare_scripts
|
|
when: >
|
|
ffu_noop|bool or
|
|
ffu_undercloud_upgrade|bool or
|
|
ffu_undercloud_os_upgrade|bool
|
|
|
|
- block:
|
|
- name: apply pre FFU undercloud OS upgrade workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./pre_ffu_undercloud_os_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} >> pre_ffu_undercloud_os_upgrade_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
|
|
# At this stage we are running the source OSP version (OSP13), which does not
|
|
# support the new tripleo-validations framework.
|
|
- name: run pre-upgrade validation before upgrading RHEL
|
|
shell: |
|
|
set -o pipefail
|
|
{{ working_dir }}/pre-upgrade-validation.sh 2>&1 {{ timestamper_cmd }} >> validation-pre-upgrade.log
|
|
when: run_validations|bool
|
|
tags:
|
|
- upgrades_validations
|
|
|
|
- name: Check that all validations succeeded
|
|
lineinfile:
|
|
path: "{{ working_dir }}/validation-pre-upgrade.log"
|
|
regexp: "^.*Failure! The validation failed for all hosts:.*$"
|
|
state: absent
|
|
check_mode: true
|
|
register: validation_results
|
|
failed_when: validation_results is changed
|
|
tags:
|
|
- upgrades_validations
|
|
when: run_validations|bool
|
|
|
|
- name: Clean up httpd folder
|
|
become: true
|
|
become_user: root
|
|
file:
|
|
path: /etc/httpd
|
|
state: absent
|
|
|
|
- name: Upgrade operating system
|
|
become: true
|
|
become_user: root
|
|
import_tasks: ../common/undercloud_os_upgrade.yaml
|
|
when: not use_oooq|bool
|
|
|
|
- name: apply post FFU undercloud OS upgrade workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./post_ffu_undercloud_os_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} >> post_ffu_undercloud_os_upgrade_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
|
|
when: ffu_undercloud_os_upgrade|bool
|
|
tags: ffu_undercloud_os_upgrade
|
|
|
|
- block:
|
|
- name: apply pre ffu undercloud upgrade workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./pre_ffu_undercloud_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} >> pre_ffu_undercloud_upgrade_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
|
|
- name: configure container specific parameters
|
|
import_tasks: ../common/configure_uc_containers.yml
|
|
|
|
- name: install/update required packages before upgrading the undercloud
|
|
become: true
|
|
become_user: root
|
|
import_tasks: ../common/undercloud_prerequisites.yaml
|
|
|
|
- name: ffu undercloud upgrade
|
|
shell: |
|
|
set -o pipefail
|
|
./ffu_undercloud_upgrade.sh 2>&1 {{ timestamper_cmd }} >> ffu_undercloud_upgrade.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
|
|
- name: apply post ffu undercloud upgrade workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./post_ffu_undercloud_upgrade_workarounds.sh 2>&1 {{ timestamper_cmd }} >> post_ffu_undercloud_upgrade_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
when: ffu_undercloud_upgrade|bool
|
|
|
|
- name: create overcloud FFU prepare scripts
|
|
include_tasks: create-overcloud-ffu-scripts.yaml
|
|
args:
|
|
apply:
|
|
tags:
|
|
- create_ffu_prepare_scripts
|
|
tags: create_ffu_prepare_scripts
|
|
when: >
|
|
ffu_noop|bool or
|
|
ffu_overcloud_upgrade|bool
|
|
|
|
- block:
|
|
- name: Ensure ansible-pacemaker module is present in CI.
|
|
package:
|
|
name: ansible-pacemaker
|
|
state: latest
|
|
when: tripleo_ci|default(false)|bool
|
|
tags: ffu_upgrade_playbook
|
|
become: true
|
|
|
|
- name: launch workload
|
|
shell: |
|
|
set -o pipefail
|
|
{{ workload_launch_script }} 2>&1 {{ timestamper_cmd }} >> workload_launch.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: workload_launch|bool
|
|
|
|
- name: start L3 verification scripts
|
|
include_tasks: "{{ item }}"
|
|
args:
|
|
apply:
|
|
tags: ffu_overcloud_prepare
|
|
loop:
|
|
- '../common/l3_agent_connectivity_check_start_script.yml'
|
|
- '../common/l3_agent_failover_check_pre_script.yml'
|
|
tags: ffu_overcloud_prepare
|
|
|
|
# At this stage, the Undercloud is in targe version and the overcloud
|
|
# in source version. Therefore we can use the tripleo-validation new
|
|
# framework, but it is required to pass the python-interpreter
|
|
- name: run pre-upgrade validation for the overcloud nodes
|
|
import_tasks: ../common/validation_group_run.yaml
|
|
vars:
|
|
validation_group: "pre-upgrade"
|
|
validation_allowed_groups: "{{ upgrades_validations_groups }}"
|
|
when: run_validations|bool
|
|
tags:
|
|
- overcloud_upgrade_prepare
|
|
- upgrades_validations
|
|
|
|
- name: convert tls templates
|
|
import_tasks: convert_tls_templates.yaml
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: replace environment files
|
|
import_tasks: ../common/replace_environment_files.yaml
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: adjust role-data for upgrade
|
|
include_tasks: ../common/adjust-roles-data.yaml
|
|
when: custom_roles_used|bool
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: check customized {{ uc_containers_prepare_file }} exists
|
|
stat:
|
|
path: "{{ working_dir }}/{{ uc_containers_prepare_file }}"
|
|
register: custom_uc_containers
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: Set the neutron_driver to ovn for the Overcloud upgrade if deployed with OVN
|
|
replace:
|
|
path: "{{ working_dir }}/{{ uc_containers_prepare_file }}"
|
|
regexp: '^(\s*neutron_driver\s*:)(.*)'
|
|
replace: '\1 ovn'
|
|
when:
|
|
- custom_uc_containers.stat.exists
|
|
- deployment_with_ovn
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: apply pre ffu overcloud prepare workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./pre_ffu_overcloud_upgrade_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} >> pre_ffu_overcloud_upgrade_prepare_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: run overcloud upgrade prepare
|
|
import_tasks: ../upgrade/overcloud_upgrade_prepare.yml
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: apply post ffu overcloud prepare workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./post_ffu_overcloud_upgrade_prepare_workarounds.sh 2>&1 {{ timestamper_cmd }} >> post_ffu_overcloud_upgrade_prepare_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: prepare containers for overcloud upgrade
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
shell: |
|
|
set -o pipefail
|
|
./overcloud_prepare_containers.sh {{ timestamper_cmd }} >> overcloud_upgrade_prepare_containers.log
|
|
tags: ffu_overcloud_prepare
|
|
|
|
- name: stop L3 verification scripts
|
|
include_tasks: "{{ item }}"
|
|
args:
|
|
apply:
|
|
tags: ffu_overcloud_prepare
|
|
loop:
|
|
- '../common/l3_agent_connectivity_check_stop_script.yml'
|
|
- '../common/l3_agent_failover_check_post_script.yml'
|
|
tags: ffu_overcloud_prepare
|
|
|
|
# This l3 check code is for now commented out for two reasons:
|
|
# 1) There is separate ping test in overcloud upgrade run which
|
|
# will be running at the same time, but the cleanup script runs
|
|
# kill -s INT $(pidof ping) which will kill them both and than
|
|
# we will fail on the final cleanup.
|
|
# 2) The workload creation and cleanup scripts work in simillar
|
|
# way. The workload cleanup does not check which workload we
|
|
# are cleaning specifically but it just removes first one on
|
|
# the list which in our case will be the host we are pinging
|
|
# here.
|
|
# - name: start L3 verification scripts
|
|
# include_tasks: "{{ item }}"
|
|
# args:
|
|
# apply:
|
|
# tags: ffu_overcloud_run
|
|
# loop:
|
|
# - '../common/l3_agent_connectivity_check_start_script.yml'
|
|
# - '../common/l3_agent_failover_check_pre_script.yml'
|
|
# tags: ffu_overcloud_run
|
|
|
|
############## OS upgrade + Overcloud node upgrade run ##############
|
|
- name: Start overcloud upgrade run with outage for all roles.
|
|
import_tasks: overcloud_upgrade_fast_and_furious.yaml
|
|
tags: ffu_overcloud_run
|
|
when: fast_and_furious|bool
|
|
|
|
############## OS upgrade + Overcloud node upgrade run ##############
|
|
- name: Start overcloud upgrade run for all roles.
|
|
import_tasks: overcloud_upgrade_roles.yaml
|
|
tags: ffu_overcloud_run
|
|
when: not fast_and_furious|bool
|
|
|
|
# - name: stop L3 verification scripts
|
|
# include_tasks: "{{ item }}"
|
|
# args:
|
|
# apply:
|
|
# tags: ffu_overcloud_run
|
|
# loop:
|
|
# - '../common/l3_agent_connectivity_check_stop_script.yml'
|
|
# - '../common/l3_agent_failover_check_post_script.yml'
|
|
# tags: ffu_overcloud_run
|
|
|
|
################ UPGRADE CONVERGE ###############
|
|
- name: apply pre ffu overcloud converge workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./pre_ffu_overcloud_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} >> pre_ffu_overcloud_converge_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
tags: ffu_overcloud_converge
|
|
|
|
- name: import overcloud upgrade converge tasks
|
|
import_tasks: ../upgrade/overcloud_upgrade_converge.yml
|
|
tags: ffu_overcloud_converge
|
|
|
|
- name: apply post ffu overcloud converge workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./post_ffu_overcloud_converge_workarounds.sh 2>&1 {{ timestamper_cmd }} >> post_ffu_overcloud_converge_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
tags: ffu_overcloud_converge
|
|
|
|
############## CEPH upgrade ######################
|
|
- when: ceph_osd_enabled|bool
|
|
block:
|
|
- name: apply pre ffu ceph upgrade workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./pre_ffu_overcloud_ceph_workarounds.sh 2>&1 {{ timestamper_cmd }} >> pre_ffu_overcloud_ceph_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
tags: ffu_overcloud_ceph
|
|
|
|
- name: import ceph upgrade tasks
|
|
import_tasks: ../upgrade/ceph_upgrade_run.yml
|
|
tags: ffu_overcloud_ceph
|
|
|
|
# This l3 check code is for now commented out for two reasons:
|
|
# 1) There is separate ping test in overcloud upgrade run which
|
|
# will be running at the same time, but the cleanup script runs
|
|
# kill -s INT $(pidof ping) which will kill them both and than
|
|
# we will fail on the final cleanup.
|
|
# 2) The workload creation and cleanup scripts work in simillar
|
|
# way. The workload cleanup does not check which workload we
|
|
# are cleaning specifically but it just removes first one on
|
|
# the list which in our case will be the host we are pinging
|
|
# here.
|
|
#
|
|
# - name: start L3 verification scripts
|
|
# include_tasks: "{{ item }}"
|
|
# args:
|
|
# apply:
|
|
# tags: ffu_overcloud_ceph
|
|
# loop:
|
|
# - '../common/l3_agent_connectivity_check_start_script.yml'
|
|
# - '../common/l3_agent_failover_check_pre_script.yml'
|
|
# tags: ffu_overcloud_ceph
|
|
|
|
- name: apply post ffu ceph upgrade workarounds
|
|
shell: |
|
|
set -o pipefail
|
|
./post_ffu_overcloud_ceph_workarounds.sh 2>&1 {{ timestamper_cmd }} >> post_ffu_overcloud_ceph_workarounds.log
|
|
args:
|
|
chdir: "{{ working_dir }}"
|
|
executable: /usr/bin/bash
|
|
when: ffu_upgrade_workarounds|bool
|
|
tags: ffu_overcloud_ceph
|
|
|
|
# - name: stop L3 verification scripts
|
|
# include_tasks: "{{ item }}"
|
|
# args:
|
|
# apply:
|
|
# tags: ffu_overcloud_ceph
|
|
# loop:
|
|
# - '../common/l3_agent_connectivity_check_stop_script.yml'
|
|
# - '../common/l3_agent_failover_check_post_script.yml'
|
|
# tags: ffu_overcloud_ceph
|
|
|
|
############## POST UPGRADE ##############
|
|
- name: run controller post upgrade steps
|
|
include_tasks: ../upgrade/controller_post_upgrade.yml
|
|
args:
|
|
apply:
|
|
tags:
|
|
- ffu_overcloud_post
|
|
tags: ffu_overcloud_post
|
|
when: controller_upgrade_post|bool
|
|
|
|
- name: run post upgrade nova actions
|
|
import_tasks: ../common/nova_actions_check.yml
|
|
tags: ffu_overcloud_post
|
|
|
|
when: ffu_overcloud_upgrade|bool
|