From 111076f599ef844fd2599172becdde55e8d565d6 Mon Sep 17 00:00:00 2001 From: Emmet O'Grady Date: Fri, 11 Aug 2017 09:42:41 +0100 Subject: [PATCH] Allow changing the restarted state --- README.md | 4 ++++ defaults/main.yml | 4 ++++ handlers/main.yml | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 04580d7..53f3d8a 100644 --- a/README.md +++ b/README.md @@ -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`. diff --git a/defaults/main.yml b/defaults/main.yml index 6d9a154..25f2c2f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/handlers/main.yml b/handlers/main.yml index 2c4645c..cce42b7 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -2,5 +2,5 @@ - name: restart postgresql service: name: "{{ postgresql_daemon }}" - state: restarted + state: "{{ postgresql_restarted_state }}" sleep: 5