Skip to content

Run OVN playbook without limit during upgrade #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions etc/kayobe/ansible/ovn-fix-chassis-priorities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,25 @@
- name: Find OVN DB DB Leader
hosts: "{{ ovn_nb_db_group | default('controllers') }}"
tasks:
- name: Find the OVN NB DB leader
ansible.builtin.command: docker exec ovn_nb_db ovn-nbctl get-connection
changed_when: false
failed_when: false
register: ovn_check_result
check_mode: false
- name: Find OVN DB Leader
when: kolla_enable_ovn | bool
block:
- name: Find the OVN NB DB leader
ansible.builtin.command: docker exec ovn_nb_db ovn-nbctl get-connection
changed_when: false
failed_when: false
register: ovn_check_result
check_mode: false

- name: Group hosts by leader/follower role
ansible.builtin.group_by:
key: "ovn_nb_{{ 'leader' if ovn_check_result.rc == 0 else 'follower' }}"
changed_when: false
- name: Group hosts by leader/follower role
ansible.builtin.group_by:
key: "ovn_nb_{{ 'leader' if ovn_check_result.rc == 0 else 'follower' }}"
changed_when: false

- name: Assert one leader exists
ansible.builtin.assert:
that:
- groups['ovn_nb_leader'] | default([]) | length == 1
- name: Assert one leader exists
ansible.builtin.assert:
that:
- groups['ovn_nb_leader'] | default([]) | length == 1

- name: Fix OVN chassis priorities
hosts: ovn_nb_leader
Expand Down
4 changes: 0 additions & 4 deletions etc/kayobe/ansible/ubuntu-upgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,3 @@
that:
- ansible_facts.distribution_major_version == '22'
- ansible_facts.distribution_release == 'jammy'

- name: Run the OVN chassis priority fix playbook
import_playbook: "{{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}/ansible/ovn-fix-chassis-priorities.yml"
when: kolla_enable_ovn
2 changes: 2 additions & 0 deletions tools/ubuntu-upgrade-overcloud.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@ set -x

kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/ubuntu-upgrade.yml -e os_release=jammy --limit $1

kayobe playbook run $KAYOBE_CONFIG_PATH/ansible/ovn-fix-chassis-priorities.yml

kayobe overcloud host configure --limit $1 --kolla-limit $1 -e os_release=jammy