Fix bugs with Patroni bootstrap
This commit is contained in:
parent
d48a7dbab6
commit
e48b6eef3a
|
@ -8,9 +8,12 @@
|
||||||
- patroni
|
- patroni
|
||||||
|
|
||||||
- name: remove any existing patroni keys in Zookeeper
|
- 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
|
ignore_errors: true
|
||||||
|
|
||||||
|
- name: regenerate locales to ensure compliance
|
||||||
|
command: locale-gen
|
||||||
|
|
||||||
- name: start Patroni
|
- name: start Patroni
|
||||||
service:
|
service:
|
||||||
name: "{{ item }}"
|
name: "{{ item }}"
|
||||||
|
@ -23,10 +26,10 @@
|
||||||
seconds: 15
|
seconds: 15
|
||||||
|
|
||||||
- name: test connecting to cluster
|
- 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
|
register: result
|
||||||
retries: 6
|
retries: 8
|
||||||
delay: 5
|
delay: 15
|
||||||
until: result.rc == 0
|
until: result.rc == 0
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
|
|
Loading…
Reference in New Issue