Skip to content

Commit

Permalink
Allow changing the restarted state
Browse files Browse the repository at this point in the history
  • Loading branch information
emmetog committed Aug 11, 2017
1 parent efd78e5 commit 111076f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ Available variables are listed below, along with default values (see `defaults/m

(RHEL/CentOS only) You can set a repo to use for the PostgreSQL installation by passing it in here.

postgresql_restarted_state: "restarted"

Set the state of the service when configuration changes are made. Recommended values are `restarted` or `reloaded`.

postgresql_python_library: python-psycopg2

Library used by Ansible to communicate with PostgreSQL. If you are using Python 3 (e.g. set via `ansible_python_interpreter`), you should change this to `python3-psycopg2`.
Expand Down
4 changes: 4 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
# RHEL/CentOS only. Set a repository to use for PostgreSQL installation.
postgresql_enablerepo: ""

# Set postgresql state when configuration changes are made. Recommended values:
# `restarted` or `reloaded`
postgresql_restarted_state: "restarted"

postgresql_python_library: python-psycopg2
postgresql_user: postgres
postgresql_group: postgres
Expand Down
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
- name: restart postgresql
service:
name: "{{ postgresql_daemon }}"
state: restarted
state: "{{ postgresql_restarted_state }}"
sleep: 5

0 comments on commit 111076f

Please sign in to comment.