From e48b6eef3a14473754c484ac4c6918985c75ba66 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Mon, 20 Dec 2021 16:30:27 -0500 Subject: [PATCH] Fix bugs with Patroni bootstrap --- roles/pvc/tasks/patroni/bootstrap.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/roles/pvc/tasks/patroni/bootstrap.yml b/roles/pvc/tasks/patroni/bootstrap.yml index 4c3ee14..a699e7c 100644 --- a/roles/pvc/tasks/patroni/bootstrap.yml +++ b/roles/pvc/tasks/patroni/bootstrap.yml @@ -8,9 +8,12 @@ - patroni - name: remove any existing patroni keys in Zookeeper - command: /usr/share/zookeeper/bin/zkCli.sh -server $(hostname -s):2181 rmr /patroni + shell: "/usr/share/zookeeper/bin/zkCli.sh -server $(hostname -s):2181 rmr /patroni" ignore_errors: true +- name: regenerate locales to ensure compliance + command: locale-gen + - name: start Patroni service: name: "{{ item }}" @@ -23,10 +26,10 @@ seconds: 15 - name: test connecting to cluster - shell: sudo -u postgres psql postgres -c 'select * from pg_stat_activity' || ( service patroni restart && exit 1 ) + shell: "sudo -u postgres psql postgres -c 'select * from pg_stat_activity' || ( systemctl restart patroni && exit 1 )" register: result - retries: 6 - delay: 5 + retries: 8 + delay: 15 until: result.rc == 0 - block: