Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix postgres check for RedHat #1389

Merged
merged 1 commit into from
Jun 26, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,22 @@
var: snapshot_name

- name: Check if database is running on node0 database server
become: true
become_user: postgres
command: "pg_isready"
register: node0
ignore_errors: True
block:
- name: Check on Debian
become: true
become_user: postgres
command: "pg_isready"
register: node0
ignore_errors: True
when: ansible_os_family == 'Debian'

- name: Check on RedHat
become: true
become_user: postgres
command: "/usr/pgsql-10/bin/pg_isready"
register: node0
ignore_errors: True
when: ansible_os_family == 'RedHat'
when: groups['postgresql'][0] == inventory_hostname

- name: Debug
Expand Down Expand Up @@ -70,4 +81,4 @@
path: "/var/tmp/{{ snapshot_name }}/"
state: absent
when: (groups['postgresql'][0] == inventory_hostname and hostvars[groups['postgresql'][0]]['node0'].rc == 0) or
(groups['postgresql'][1] == inventory_hostname and hostvars[groups['postgresql'][0]]['node0'].rc != 0)
(groups['postgresql'][1] == inventory_hostname and hostvars[groups['postgresql'][0]]['node0'].rc != 0)