Retry pgsql bootstrap startup 6 times
This will sometimes fail, so retry it several times
This commit is contained in:
parent
e9f08ad100
commit
26dbd082ef
|
@ -11,7 +11,7 @@
|
||||||
command: /usr/share/zookeeper/bin/zkCli.sh rmr /patroni
|
command: /usr/share/zookeeper/bin/zkCli.sh rmr /patroni
|
||||||
ignore_errors: true
|
ignore_errors: true
|
||||||
|
|
||||||
- name: ensure patroni services are enabled and started on this host so it becomes leader
|
- name: ensure patroni services are enabled and started
|
||||||
service:
|
service:
|
||||||
name: "{{ item }}.service"
|
name: "{{ item }}.service"
|
||||||
state: started
|
state: started
|
||||||
|
@ -23,6 +23,13 @@
|
||||||
pause:
|
pause:
|
||||||
seconds: 15
|
seconds: 15
|
||||||
|
|
||||||
|
- name: test connecting to cluster
|
||||||
|
shell: sudo -u postgres psql postgres -c 'select * from pg_stat_activity' || ( service patroni restart && exit 1 )
|
||||||
|
register: result
|
||||||
|
retries: 6
|
||||||
|
delay: 5
|
||||||
|
until: result.rc == 0
|
||||||
|
|
||||||
- block:
|
- block:
|
||||||
- name: create user for DNS role
|
- name: create user for DNS role
|
||||||
postgresql_user:
|
postgresql_user:
|
||||||
|
|
Loading…
Reference in New Issue