Fix bugs with Patroni bootstrap
This commit is contained in:
parent
d48a7dbab6
commit
e48b6eef3a
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue