Skip to content

Commit

Permalink
Merge pull request Demonware#3 from onaio/travisci-build
Browse files Browse the repository at this point in the history
Use pg_ctlcluster to Reload Config Files
  • Loading branch information
morrismukiri authored Aug 12, 2021
2 parents e3f22bf + d2e5860 commit 96613d7
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,17 @@
mode: u=rwX,g=rwXs,o=rx
notify: restart postgresql

- name: PostgreSQL | Reload all conf files
service:
name: "{{ postgresql_service_name }}"
state: reloaded
- block:
- name: PostgreSQL | Check if cluster is running
command: "pg_ctlcluster {{ postgresql_version }} {{ postgresql_cluster_name }} status"
ignore_errors: true
register: postgresql_cluster_running

- name: PostgreSQL | Reload cluster
command: "pg_ctlcluster {{ postgresql_version }} {{ postgresql_cluster_name }} reload"
when: postgresql_cluster_running.rc == 0

- name: PostgreSQL | Start cluster
command: "pg_ctlcluster {{ postgresql_version }} {{ postgresql_cluster_name }} start"
when: postgresql_cluster_running.rc != 0
when: postgresql_configuration_pt1.changed or postgresql_configuration_pt2.changed or postgresql_configuration_pt3.changed or postgresql_systemd_custom_conf.changed

0 comments on commit 96613d7

Please sign in to comment.