Skip to content

Commit

Permalink
Resolve ANXS#361 : Revert to using Ansible service module for restart…
Browse files Browse the repository at this point in the history
…ing Postgresql on RH systems
  • Loading branch information
stejoo committed Sep 17, 2018
1 parent d0cc433 commit 0511b6a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 15 deletions.
10 changes: 1 addition & 9 deletions handlers/main.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
# file: postgresql/handlers/main.yml

- name: restart postgresql with service
- name: restart postgresql
service:
name: "{{ postgresql_service_name }}"
state: restarted
enabled: yes

- name: restart postgresql with systemd
systemd:
name: "{{ postgresql_service_name }}"
state: restarted
enabled: yes
when: ansible_service_mgr == 'systemd'

6 changes: 3 additions & 3 deletions tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
group: "{{ postgresql_service_group }}"
mode: 0640
register: postgresql_configuration_pt4
notify: restart postgresql with service
notify: restart postgresql

- name: PostgreSQL | Create folder for additional configuration files
file:
Expand All @@ -176,7 +176,7 @@
state: directory
mode: 0755
when: ansible_os_family == "RedHat"
notify: restart postgresql with systemd
notify: restart postgresql

- name: PostgreSQL | Use the conf directory when starting the Postgres service | RedHat
template:
Expand All @@ -192,7 +192,7 @@
owner: "{{ postgresql_service_user }}"
group: "{{ postgresql_service_group }}"
mode: u=rwX,g=rwXs,o=rx
notify: restart postgresql with service
notify: restart postgresql

- name: PostgreSQL | Reload all conf files
service:
Expand Down
5 changes: 2 additions & 3 deletions tasks/extensions/dev_headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@
- "postgresql{{ postgresql_version_terse }}-devel"
when: ansible_pkg_mgr == "yum" and ansible_os_family == "RedHat"
notify:
- restart postgresql with service
- restart postgresql with systemd
- restart postgresql

- name: PostgreSQL | Extensions | Make sure the development headers are installed | Fedora
dnf:
name: "postgresql{{ postgresql_version_terse }}-libs, postgresql{{ postgresql_version_terse }}-devel"
state: present
when: ansible_pkg_mgr == "dnf" and ansible_distribution == "Fedora"
notify:
- restart postgresql with systemd
- restart postgresql

0 comments on commit 0511b6a

Please sign in to comment.