Michal Nasiadka 7cc4bf6203 ovn: Improve clustering
Currently clustering steps are very static, if for a reason first
node in the inventory fails and gets re-introduced - K-A will create
a second empty cluster on that node.

This patch changes the approach and checks if cluster exists, if it
does - chooses a donor for the new node from currently running
node set.

Also it fixes node replacement - it removes old node from cluster
(that has the same ip address as newly provisioned node).

Closes-Bug: #1875223

Change-Id: Ia025283e38ea7c3bd37c7a70d03f6b46c68f4456
2023-09-05 09:18:38 +00:00

23 lines
595 B
YAML

---
- include_tasks: lookup_cluster.yml
when:
- inventory_hostname in groups['ovn-nb-db'] or
inventory_hostname in groups['ovn-sb-db']
- include_tasks: bootstrap-initial.yml
when:
- inventory_hostname in groups.get('ovn-nb-db_had_volume_False', '') or
inventory_hostname in groups.get('ovn-sb-db_had_volume_False', '')
- import_tasks: config.yml
- import_tasks: check-containers.yml
- name: Flush handlers
meta: flush_handlers
- import_tasks: bootstrap-db.yml
when:
- inventory_hostname in groups['ovn-nb-db']
- inventory_hostname in groups['ovn-sb-db']