From 211f83995bb9ca608109af3932ea0494e5c4ccc9 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Fri, 1 Sep 2023 15:42:22 -0400 Subject: [PATCH] Ensure the Patroni ZK is clean for bootstrap --- roles/pvc/tasks/patroni/bootstrap.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/roles/pvc/tasks/patroni/bootstrap.yml b/roles/pvc/tasks/patroni/bootstrap.yml index 8617cc5..6ab3147 100644 --- a/roles/pvc/tasks/patroni/bootstrap.yml +++ b/roles/pvc/tasks/patroni/bootstrap.yml @@ -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