From 65683252c4bbd02876dbfa6a31282af038abc86f Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Tue, 12 Jun 2018 19:52:58 +0100 Subject: [PATCH] Use separate state for restarting service re: `postgresql.conf` --- postgres/server/init.sls | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 99ffe78..9a89184 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -122,7 +122,7 @@ postgresql-conf: - file: postgresql-conf-comment-port {%- endif %} - watch_in: - - service: postgresql-running + - service: postgresql-service-restart {%- endif %} @@ -204,11 +204,19 @@ postgresql-running: service.running: - name: {{ postgres.service }} - enable: True - {% if grains.os not in ('MacOS',) and not db_port %} + {% if grains.os not in ('MacOS',) %} - reload: True {% endif %} - watch: - file: postgresql-pg_hba - file: postgresql-pg_ident +# Restart the service where reloading is not sufficient +# Currently when changes are made to `postgresql.conf` +{%- if postgres.postgresconf or db_port %} +postgresql-service-restart: + service.running: + - name: {{ postgres.service }} +{%- endif %} + {%- endif %}