Skip to content

Commit 690bc72

Browse files
committed
Fix OVN leader detection in chassis priority fix
After kolla-ansible patch [1] ovn commands can run on all nodes. Changing method of getting the leader. [1] https://review.opendev.org/c/openstack/kolla-ansible/+/963412 Signed-off-by: Bartosz Bezak <bartosz@stackhpc.com>
1 parent 6946bf2 commit 690bc72

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

etc/kayobe/ansible/fixes/ovn-fix-chassis-priorities.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@
2525
when: kolla_enable_ovn | bool
2626
block:
2727
- name: Find the OVN NB DB leader
28-
ansible.builtin.command: docker exec ovn_nb_db ovn-nbctl get-connection
28+
ansible.builtin.command: docker exec ovn_nb_db ovs-appctl -t /var/run/ovn/ovnnb_db.ctl cluster/status OVN_Northbound
2929
changed_when: false
3030
failed_when: false
31-
register: ovn_check_result
31+
register: ovn_cluster_status
3232
check_mode: false
3333

3434
- name: Group hosts by leader/follower role
3535
ansible.builtin.group_by:
36-
key: ovn_nb_{{ 'leader' if ovn_check_result.rc == 0 else 'follower' }}
36+
key: "{{ 'ovn_nb_leader' if 'Role: leader' in ovn_cluster_status.stdout else 'ovn_nb_follower' }}"
3737
changed_when: false
3838

3939
- name: Assert one leader exists

0 commit comments

Comments
 (0)