ovn_dbs upgrade-with-os work

This adds the missing steps for the upgrades-with-os blueprint for
the ovn_dbs service. The ovn_dbs pacemaker service was not taken care of
in the initial work in cb8caaae43
This commit tries to fix that.

Closes-Bug: #1854519

Tested-by: Jose Luis Franco Arza <jfrancoa@redhat.com>

Depends-On: I7bff96c0b0238e4aeaa33e0ec343a75e08b6a2f7
Change-Id: Id90754ad2506ee52d2a2cb939ccbf2d84e792cff
This commit is contained in:
Michele Baldessari 2019-11-29 15:57:29 +01:00
parent 8baf366b6d
commit 36a84820e5

View File

@ -403,6 +403,54 @@ outputs:
register: output
retries: 5
until: output.rc == 0
- when:
- step|int == 1
block:
- name: set ovn_dbs upgrade node facts in a single-node environment
set_fact:
ovn_dbs_short_node_names_upgraded: "{{ ovn_dbs_short_node_names }}"
cacheable: no
when: groups['ovn_dbs'] | length <= 1
- name: set ovn_dbs upgrade node facts from the limit option
set_fact:
ovn_dbs_short_node_names_upgraded: "{{ ovn_dbs_short_node_names_upgraded|default([]) + [item.split('.')[0]] }}"
cacheable: no
when:
- groups['ovn_dbs'] | length > 1
- item.split('.')[0] in ansible_limit.split(',')
loop: "{{ ovn_dbs_short_node_names }}"
- debug:
msg: "Prepare ovn_dbs upgrade for {{ ovn_dbs_short_node_names_upgraded }}"
- fail:
msg: >
You can't upgrade ovn_dbs without staged
upgrade. You need to use the limit option in order
to do so.
when: >-
ovn_dbs_short_node_names_upgraded is not defined or
ovn_dbs_short_node_names_upgraded | length == 0
- name: remove ovn_dbs init container on upgrade-scaleup to force re-init
shell: |
if podman inspect ovn_dbs_init_bundle &> /dev/null; then
podman rm ovn_dbs_init_bundle
fi
when: ovn_dbs_short_node_names_upgraded | length > 1
- name: add the ovn_dbs short name to hiera data for the upgrade.
include_role:
name: tripleo-upgrade-hiera
tasks_from: set.yml
vars:
tripleo_upgrade_key: ovn_dbs_short_node_names_override
tripleo_upgrade_value: "{{ovn_dbs_short_node_names_upgraded}}"
- name: remove the extra hiera data needed for the upgrade.
include_role:
name: tripleo-upgrade-hiera
tasks_from: remove.yml
vars:
tripleo_upgrade_key: ovn_dbs_short_node_names_override
when: ovn_dbs_short_node_names_upgraded | length == ovn_dbs_short_node_names | length
- name: Retag the pacemaker image if containerized
when:
- step|int == 3