From 67d6b8a5450906669bba6cea33253d03b228d4ec Mon Sep 17 00:00:00 2001 From: Imran Iqbal Date: Thu, 21 Jun 2018 08:06:08 +0100 Subject: [PATCH] Ensure service starts after cluster created --- postgres/server/init.sls | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/postgres/server/init.sls b/postgres/server/init.sls index 824eadc..3ffb75b 100644 --- a/postgres/server/init.sls +++ b/postgres/server/init.sls @@ -85,6 +85,8 @@ postgresql-cluster-prepared: - require: - pkg: postgresql-server - file: postgresql-cluster-prepared + - watch_in: + - module: postgresql-service-restart postgresql-config-dir: file.directory: @@ -140,15 +142,15 @@ postgresql-conf: - watch_in: - module: postgresql-service-restart +{%- endif %} + # Restart the service where reloading is not sufficient -# Currently only when changes are made to `postgresql.conf` +# Currently when the cluster is created or changes made to `postgresql.conf` postgresql-service-restart: module.wait: - name: service.restart - m_name: {{ postgres.service }} -{%- endif %} - {%- set pg_hba_path = salt['file.join'](postgres.conf_dir, 'pg_hba.conf') %} postgresql-pg_hba: