From 8426b5231f67f9d72bd7f06006a217d5b2bb7515 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Fri, 30 Jun 2017 13:39:03 +0100 Subject: [PATCH] Use listen instead of chained notifiers From Ansible 2.2 onwards, listen can be used for handlers instead of chaining notifiers. The handlers are then executed in the sequence present in the handler file. Change-Id: Ia185ab830005f311f37d4eb7dfab1ae116419e3b (cherry picked from commit af9142ec9bd95db83628130800b9a34c13d2e527) --- handlers/main.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index 6a237eeb..63871f4a 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -13,13 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -- name: Restart glance services - command: "/bin/true" - notify: - - Stop services - - Copy new policy file into place - - Start services - - name: Stop services service: name: "{{ item.service_name }}" @@ -31,6 +24,7 @@ until: _stop | success retries: 5 delay: 2 + listen: "Restart glance services" # Note (odyssey4me): # The policy.json file is currently read continually by the services @@ -48,6 +42,7 @@ group: "{{ glance_system_group_name }}" mode: "0640" remote_src: yes + listen: "Restart glance services" - name: Start services service: @@ -60,3 +55,4 @@ until: _start | success retries: 5 delay: 2 + listen: "Restart glance services"