FFWD3 Refactor ffwd upgrade for train to wallaby

This is first attempt to test whole upgrade procedure from
Train to Wallaby. We for now deal just with the OpenStack
upgrade part without OS upgrade step. When we will understand
the process better we will refactor this code.

Changes:
- Remove tls templates comversion.
- Cleanup adjust-roles-data. We might introduce new ones.
- Handle the network switch to ansible templates
- For now use Fast Furious procedure to generate playbook
- Add ceph adoption workflow from ceph-ansible to cephadm

Co-authored-by: jbadiapa@redhat.com

Change-Id: Iae1c9ef1244676589ee505201093daa52704a438
This commit is contained in:
Lukas Bezdicka 2022-07-13 15:44:59 +02:00 committed by Jesse Pretorius
parent 82d657351e
commit 65d0c1d44c
8 changed files with 66 additions and 160 deletions

View File

@ -1,135 +1,4 @@
--- ---
- name: add OsloMessagingRpc and OsloMessagingNotify services
replace:
path: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::RabbitMQ$)'
replace: '\1\2\1- {{ item }}'
loop:
- "OS::TripleO::Services::OsloMessagingRpc"
- "OS::TripleO::Services::OsloMessagingNotify"
- name: drop RabbiMQ service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::RabbitMQ$)'
replace: ''
- name: Replace Docker for Podman service
replace:
path: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::Docker$)'
replace: '\1- OS::TripleO::Services::Podman'
- name: Replace NovaPlacement for PlacementApi service
replace:
path: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::NovaPlacement$)'
replace: '\1- OS::TripleO::Services::PlacementApi'
- name: drop Congress service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::Congress$)'
replace: ''
- name: Replace Fluentd for Rsyslog service
replace:
path: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::Fluentd$)'
replace: '\1- OS::TripleO::Services::Rsyslog'
- name: Replace SensuClient for Collectd service
replace:
path: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::SensuClient$)'
replace: '\1- OS::TripleO::Services::Collectd'
- name: add ContainerImagePrepare service
replace:
path: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::HAproxy$)'
replace: '\1\2\1- OS::TripleO::Services::ContainerImagePrepare'
- name: add BootParams service
replace:
path: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::AuditD$)'
replace: '\1\2\1- OS::TripleO::Services::BootParams'
- name: drop deprecated telemetry services
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::{{ item }}$)'
replace: ''
loop:
- CeilometerApi
- CeilometerCollector
- CeilometerExpirer
- name: drop MongDB service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::MongoDb$)'
replace: ''
- name: drop GlanceRegistry service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::GlanceRegistry$)'
replace: ''
- name: drop NovaConsoleAuth service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::NovaConsoleauth$)'
replace: ''
- name: drop OpenDaylight services
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::{{ item }}$)'
replace: ''
loop:
- OpenDaylightOvs
- OpenDaylightApi
- name: drop NeutronLBaas services
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::{{ item }}$)'
replace: ''
loop:
- NeutronLbaasv2Agent
- NeutronLbaasv2Api
- name: drop Tacker service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::Tacker$)'
replace: ''
- name: drop Panko service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::PankoApi$)'
replace: ''
- name: drop Ntp service
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::Ntp$)'
replace: ''
- name: drop Skydive services
replace:
dest: "{{ roles_data }}"
regexp: '(\s+)(- OS::TripleO::Services::{{ item }}$)'
replace: ''
loop:
- SkydiveAgent
- SkydiveAnalyzer
# By default we have update_serial either unset at all for OSP13 and OSP14 or # By default we have update_serial either unset at all for OSP13 and OSP14 or
# we have it set where Pacemaker enabled nodes, CephOSD nodes and Networkers # we have it set where Pacemaker enabled nodes, CephOSD nodes and Networkers
# have it set to 1. This is mostly defensive precaution and we do allow running # have it set to 1. This is mostly defensive precaution and we do allow running

View File

@ -98,6 +98,11 @@
set_fact: set_fact:
initial_env_file: "{{ initial_env_file }}" initial_env_file: "{{ initial_env_file }}"
- name: get network environment fact for FFWD3
set_fact:
network_environment_file: "{{initial_env_file.stdout_lines | select('search','network-environment')| first}}"
when: initial_env_file.stdout_lines | select('search','network-environment') | list | count > 0
- name: fetch roles-data file referenced in initial deploy script - name: fetch roles-data file referenced in initial deploy script
shell: | shell: |
awk '/-r\s|--roles-file\s/ {gsub(/[[:space:]]/, "", $2); print $2}' {{ overcloud_deploy_script }} awk '/-r\s|--roles-file\s/ {gsub(/[[:space:]]/, "", $2); print $2}' {{ overcloud_deploy_script }}

View File

@ -1,20 +0,0 @@
---
- name: look for OS::TripleO::NodeTLSData config
shell: |
grep "OS::TripleO::NodeTLSData" {{ item }}
ignore_errors: true
register: tls_config_envs
loop: "{{ initial_env_file.stdout_lines }}"
- name: set tls_node_data fact
set_fact:
tls_node_data: "{{ item.item }}"
when: item.stdout|length > 0
loop: "{{ tls_config_envs.results }}"
- name: Remove NodeTLSData service
replace:
path: "{{ tls_node_data }}"
regexp: '(\s+)(OS::TripleO::NodeTLSData).*'
replace: '\1OS::TripleO::NodeTLSData: OS::Heat::None'
when: tls_node_data is defined

View File

@ -119,7 +119,7 @@
pcs_present: false pcs_present: false
compute_present: false compute_present: false
include_tasks: create-overcloud-ffu-hosts-scripts.yaml include_tasks: create-overcloud-ffu-hosts-scripts.yaml
with_together: "{{ (oc_roles_hosts|dict2items | default([])) | map(attribute='value') | map('sort') | flatten(1) }}" with_together: "{{ (oc_roles_hosts|dict2items | default([])) | map(attribute='value') | map('sort') | flatten(1) + ['undercloud'] }}"
- name: build extra templates based on new options. - name: build extra templates based on new options.
import_tasks: ../common/build_extra_template.yaml import_tasks: ../common/build_extra_template.yaml
@ -127,7 +127,10 @@
- name: create overcloud upgrade prepare script - name: create overcloud upgrade prepare script
vars: vars:
old_img: "{{ working_dir }}/{{ container_registry_file }}" old_img:
- "{{ working_dir }}/{{ container_registry_file }}"
- "/usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml"
- "{{ network_environment_file | default('') }}"
template: template:
src: "overcloud_upgrade_prepare.sh.j2" src: "overcloud_upgrade_prepare.sh.j2"
dest: "{{ overcloud_upgrade_prepare_script }}" dest: "{{ overcloud_upgrade_prepare_script }}"
@ -136,13 +139,28 @@
- name: create overcloud converge script - name: create overcloud converge script
vars: vars:
old_img: "{{ working_dir }}/{{ container_registry_file }}" old_img:
- "{{ working_dir }}/{{ container_registry_file }}"
- "/usr/share/openstack-tripleo-heat-templates/environments/network-isolation.yaml"
- "{{ network_environment_file | default('') }}"
template: template:
src: "overcloud_upgrade_converge.sh.j2" src: "overcloud_upgrade_converge.sh.j2"
dest: "{{ working_dir }}/overcloud_upgrade_converge.sh" dest: "{{ working_dir }}/overcloud_upgrade_converge.sh"
mode: 0775 mode: 0775
force: true force: true
- name: create ceph_host_limit file
vars:
# roles where the cephadm-admin and keyring is shared
ceph_limit_roles:
- Undercloud
- ceph_osd
- ceph_mon
template:
src: "ceph_host_limit.txt.j2"
dest: "{{ working_dir }}/ceph_host_limit.txt"
mode: 0764
- name: create ceph upgrade script - name: create ceph upgrade script
template: template:
src: "ceph-upgrade-run.sh.j2" src: "ceph-upgrade-run.sh.j2"

View File

@ -152,10 +152,6 @@
- overcloud_upgrade_prepare - overcloud_upgrade_prepare
- upgrades_validations - upgrades_validations
- name: convert tls templates
import_tasks: convert_tls_templates.yaml
tags: ffu_overcloud_prepare
- name: replace environment files - name: replace environment files
import_tasks: ../common/replace_environment_files.yaml import_tasks: ../common/replace_environment_files.yaml
tags: ffu_overcloud_prepare tags: ffu_overcloud_prepare

View File

@ -18,4 +18,4 @@
{{ (oc_roles_hosts|dict2items | default([])) | {{ (oc_roles_hosts|dict2items | default([])) |
map(attribute='value') | map('sort') | flatten(1) }} map(attribute='value') | map('sort') | flatten(1) }}
include_tasks: overcloud_upgrade_hosts.yaml include_tasks: overcloud_upgrade_hosts.yaml
with_together: "{{ (oc_role_host_list | length == 0) | ternary([[], []], oc_role_host_list) }}" with_together: "{{ (oc_role_host_list | length == 0) | ternary([[], []], oc_role_host_list) + ['undercloud'] }}"

View File

@ -37,9 +37,44 @@ openstack overcloud external-upgrade run ${EXTERNAL_ANSWER} \
{% if ceph_upgrade_skip_tags|default(false) -%} {% if ceph_upgrade_skip_tags|default(false) -%}
--skip-tags "{{ ceph_upgrade_skip_tags }}" \ --skip-tags "{{ ceph_upgrade_skip_tags }}" \
{% endif -%} {% endif -%}
--tags ceph 2>&1 --tags ceph,facts 2>&1
echo "[$(date)] Major upgrade - finished Ceph upgrade step" echo "[$(date)] Major upgrade - finished Ceph upgrade step"
## Install cephadm on the servers
echo "[$(date)] Major upgrade - cephadm-admin user and distribute keyrings step"
ANSIBLE_LOG_PATH=/home/stack/cephadm_enable_user_key.log \
ANSIBLE_HOST_KEY_CHECKING=false \
ansible-playbook -i /home/stack/overcloud-deploy/{{ overcloud_stack_name }}/config-download/{{ overcloud_stack_name }}/tripleo-ansible-inventory.yaml \
-b -e ansible_python_interpreter=/usr/libexec/platform-python /usr/share/ansible/tripleo-playbooks/ceph-admin-user-playbook.yml \
-e tripleo_admin_user=ceph-admin \
-e distribute_private_key=true \
--limit @/home/stack/ceph_host_limit.txt
echo "[$(date)] Major upgrade - finished cephadm-admin user and distribute keyrings step"
echo "[$(date)] Major upgrade - upgrade run setup_packages"
openstack overcloud upgrade run ${EXTERNAL_ANSWER} \
--stack {{ overcloud_stack_name }} \
--tags setup_packages --limit @/home/stack/ceph_host_limit.txt --playbook /home/stack/overcloud-deploy/{{ overcloud_stack_name }}/config-download/{{ overcloud_stack_name }}/upgrade_steps_playbook.yaml 2>&1
echo "[$(date)] Major upgrade - upgrade run setup_packages"
echo "[$(date)] Major upgrade - Cephadm adoption"
openstack overcloud external-upgrade run ${EXTERNAL_ANSWER} \
--stack {{ overcloud_stack_name }} \
{% if ceph_upgrade_skip_tags|default(false) -%}
--skip-tags "{{ ceph_upgrade_skip_tags }}" \
{% endif -%}
--tags cephadm_adopt 2>&1
echo "[$(date)] Major upgrade - finished Cephadm adoption step"
{% if l3_agent_connectivity_check|bool %} {% if l3_agent_connectivity_check|bool %}
if [[ -e {{ working_dir }}/l3_agent_stop_ping.sh ]]; then if [[ -e {{ working_dir }}/l3_agent_stop_ping.sh ]]; then
source {{ overcloud_rc }} source {{ overcloud_rc }}

View File

@ -0,0 +1,3 @@
{% for role in ceph_limit_roles -%}
{{ role }}
{% endfor -%}