From 2a772fc791c697185884f3ef0880a0df3dbaeefe Mon Sep 17 00:00:00 2001 From: Tymon Tobolski Date: Sun, 13 Apr 2014 18:04:42 +0200 Subject: [PATCH 1/2] Bring back service restart on first run [closes #5] --- tasks/configure.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 061eaf8f..741b654a 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -19,8 +19,7 @@ owner: "{{postgresql_admin_user}}" group: "{{postgresql_admin_user}}" mode: 0640 - notify: - - restart postgresql + register: postgresql_configuration_changed - name: PostgreSQL | Update configuration - pt. 2 (postgresql.conf) template: @@ -29,10 +28,10 @@ owner: "{{postgresql_admin_user}}" group: "{{postgresql_admin_user}}" mode: 0640 - notify: - - restart postgresql + register: postgresql_configuration_changed - name: PostgreSQL | Restart PostgreSQL service: name: postgresql - state: started + state: restarted + when: postgresql_configuration_changed From 0442ec245b75ffa2ecf44a9225b95d747cf67977 Mon Sep 17 00:00:00 2001 From: Tymon Tobolski Date: Sun, 13 Apr 2014 19:23:57 +0200 Subject: [PATCH 2/2] [fix] Check both configuration files separately --- tasks/configure.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 741b654a..f29e9bf5 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -19,7 +19,7 @@ owner: "{{postgresql_admin_user}}" group: "{{postgresql_admin_user}}" mode: 0640 - register: postgresql_configuration_changed + register: postgresql_configuration_pt1 - name: PostgreSQL | Update configuration - pt. 2 (postgresql.conf) template: @@ -28,10 +28,10 @@ owner: "{{postgresql_admin_user}}" group: "{{postgresql_admin_user}}" mode: 0640 - register: postgresql_configuration_changed + register: postgresql_configuration_pt2 - name: PostgreSQL | Restart PostgreSQL service: name: postgresql state: restarted - when: postgresql_configuration_changed + when: postgresql_configuration_pt1.changed or postgresql_configuration_pt2.changed