Merge pull request #24 from emmetog/specify-restart-state

Specify restart state
This commit is contained in:
Jeff Geerling 2018-04-24 15:27:42 -05:00 committed by GitHub
commit 53d1245169
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -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`.

View File

@ -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

View File

@ -1,3 +1,6 @@
---
- name: restart postgresql
service: "name={{ postgresql_daemon }} state=restarted sleep=5"
service:
name: "{{ postgresql_daemon }}"
state: "{{ postgresql_restarted_state }}"
sleep: 5