Fix bugs with Patroni bootstrap

This commit is contained in:
Joshua Boniface 2023-09-01 15:42:28 -04:00
parent 167599ac6c
commit 3397dacab4
1 changed files with 7 additions and 4 deletions

View File

@ -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: