Ensure the Patroni ZK is clean for bootstrap

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:22 -04:00
parent c27244f72d
commit 211f83995b
1 changed files with 13 additions and 1 deletions

View File

@ -1,5 +1,17 @@
---
- name: ensure patroni services are enabled and started on this host so it becomes header
- name: stop patroni services
service:
name: "{{ item }}.service"
state: stopped
enabled: no
with_items:
- patroni
- name: remove any existing patroni keys in Zookeeper
command: /usr/share/zookeeper/bin/zkCli.sh rmr /patroni
ignore_errors: true
- name: ensure patroni services are enabled and started on this host so it becomes leader
service:
name: "{{ item }}.service"
state: started