diff --git a/README.md b/README.md index d4a8339..760262c 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 523ad1b..cce42b7 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -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