From 97cf209d69a69db33b8034aa0efb2d7e5e21c95d Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Wed, 3 May 2017 15:30:43 +0100 Subject: [PATCH] Use handlers based on filtered_nova_services Change-Id: I3f9cde33af0a5f2aaeb0aedc964cb03a40ccbb9f --- handlers/main.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/handlers/main.yml b/handlers/main.yml index e8533ae1..e4acab28 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -32,9 +32,7 @@ state: "restarted" daemon_reload: yes register: nova_conductor_restart - when: - - "{{ nova_services['nova-conductor']['group'] in group_names }}" - - "{{ nova_services['nova-conductor']['condition'] | default(true) }}" + when: '"nova-conductor" in filtered_nova_services' - name: Restart nova API systemd: @@ -42,9 +40,7 @@ state: "restarted" daemon_reload: yes register: nova_api_restart - when: - - "{{ nova_services['nova-api-os-compute']['group'] in group_names }}" - - "{{ nova_services['nova-api-os-compute']['condition'] | default(true) }}" + when: '"nova-api-os-compute" in filtered_nova_services' # Used for services where restart ordering does not matter - name: Restart nova misc services @@ -60,9 +56,7 @@ - nova-scheduler - nova-spicehtml5proxy - nova-placement-api - when: - - "{{ nova_services[item]['group'] in group_names }}" - - "{{ nova_services[item]['condition'] | default(true) }}" + when: 'item in filtered_nova_services' - name: Restart nova compute systemd: @@ -70,9 +64,7 @@ state: "restarted" daemon_reload: yes register: nova_compute_restart - when: - - "{{ nova_services['nova-compute']['group'] in group_names }}" - - "{{ nova_services['nova-compute']['condition'] | default(true) }}" + when: '"nova-compute" in filtered_nova_services' - name: Reload Nginx systemd: