Skip to content

Commit

Permalink
fix error "non-zero return code rc: 3" for task "check PostgreSQL is …
Browse files Browse the repository at this point in the history
…started".

for postgresql_exists = 'true'

Do not treat return code 3 "pg_ctl: no server running" as an error.

P.S.
If PostgreSQL is stopped, it will be automatically started (task "Prepare PostgreSQL | start PostgreSQL").
  • Loading branch information
vitabaks committed Sep 16, 2020
1 parent 6cee7e5 commit 1701264
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions roles/patroni/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,9 @@
command: "{{ postgresql_bin_dir }}/pg_ctl status -D {{ postgresql_data_dir }}"
register: pg_ctl_status_result
changed_when: false
failed_when:
- pg_ctl_status_result.rc != 0
- pg_ctl_status_result.rc != 3

# "Debian"
- name: Prepare PostgreSQL | start PostgreSQL
Expand Down

0 comments on commit 1701264

Please sign in to comment.