Skip to content
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
9 changes: 6 additions & 3 deletions etc/kayobe/ansible/fixes/ovn-fix-chassis-priorities.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,18 @@
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
ansible.builtin.command: >-
docker exec ovn_nb_db
ovs-appctl -t /var/run/ovn/ovnnb_db.ctl
cluster/status OVN_Northbound
changed_when: false
failed_when: false
register: ovn_check_result
register: ovn_cluster_status
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' }}
key: "{{ 'ovn_nb_leader' if 'Role: leader' in ovn_cluster_status.stdout else 'ovn_nb_follower' }}"
changed_when: false

- name: Assert one leader exists
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
fixes:
- |
Updated the OVN chassis priority fix playbook to detect the northbound
database leader via ``ovs-appctl cluster/status``, ensuring only the true
leader runs the priority alignment.
Loading