tripleo-upgrade/tasks/common/adjust-roles-data.yaml
Lukas Bezdicka feef2cb04e 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
2022-11-24 17:31:59 +00:00

42 lines
1.7 KiB
YAML

---
# 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
# have it set to 1. This is mostly defensive precaution and we do allow running
# in parallel for CephOSD and Networkers for production systems that did enough
# testing on preprod or can take small outage. We should also parallelize it in
# CI as we just waste time here.
- name: Read the existing roles data file
slurp:
src: "{{ roles_data }}"
register: _roles_data_slurp
- name: Transform the roles data file update_serial values
vars:
old_roles_data: "{{ _roles_data_slurp['content'] | b64decode | from_yaml }}"
when: "'OS::TripleO::Services::Pacemaker' in old_roles_data | json_query('[].ServicesDefault[]')"
block:
- name: Backup original roles data file
copy:
src: "{{ roles_data }}"
dest: "{{ roles_data | regex_replace('.yaml$') }}.original.yaml"
remote_src: true
force: false
- name: Write new roles data file with revised update_serial
copy:
content: >-
{%- set new_data = [] %}
{%- for data_item in old_roles_data %}
{%- if 'ServiceDefault' in data_item %}
{%- if 'OS::TripleO::Services::Pacemaker' in data_item['ServicesDefault'] %}
{%- set _ = data_item.update({'update_serial': 1}) %}
{%- else %}
{%- set _ = data_item.update({'update_serial': 25}) %}
{%- endif %}
{%- endif %}
{%- set _ = new_data.append(data_item) %}
{%- endfor %}
{{- new_data | to_nice_yaml(indent=2) }}
dest: "{{ roles_data }}"