From 79ab1a29309daba6bb19b59831e354b8d07ae1c7 Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Sat, 16 Jun 2018 12:38:48 +0100 Subject: [PATCH] Avoid duplicate Jinja conditional block by moving service restart --- postgres/server/init.sls | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 9a89184..ddb736c 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -122,7 +122,14 @@ postgresql-conf: - file: postgresql-conf-comment-port {%- endif %} - watch_in: - - service: postgresql-service-restart + - module: postgresql-service-restart + +# Restart the service where reloading is not sufficient +# Currently only when changes are made to `postgresql.conf` +postgresql-service-restart: + module.wait: + - name: service.restart + - m_name: {{ postgres.service }} {%- endif %} @@ -211,12 +218,4 @@ postgresql-running: - 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 %}