From 8ec632c42c8ec9db10196d6ac6aca40caa462b91 Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Wed, 2 Oct 2019 14:48:53 -0400 Subject: [PATCH] ceph-handler: don't restart all OSDs with limit When using the ansible --limit option on one or few OSD nodes and if the handler is triggered then we will restart the OSD service on all OSDs nodes instead of the hosts limited by the limit value. Even if the play is limited by the --limit value we are using all OSD nodes from the OSD group. with_items: '{{ groups[osd_group_name] }}' Instead we should iterate only on the nodes present in both OSD group and limit list. Signed-off-by: Dimitri Savineau (cherry picked from commit 0346871fb5c46fb1fedfb24ffe5a8c02108c244e) --- roles/ceph-handler/handlers/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/ceph-handler/handlers/main.yml b/roles/ceph-handler/handlers/main.yml index 59e7fc5af..5ac3deeec 100644 --- a/roles/ceph-handler/handlers/main.yml +++ b/roles/ceph-handler/handlers/main.yml @@ -92,7 +92,7 @@ - ceph_current_status.fsid is defined - handler_health_osd_check | bool - hostvars[item]['_osd_handler_called'] | default(False) | bool - with_items: "{{ groups[osd_group_name] }}" + with_items: "{{ groups[osd_group_name] | intersect(ansible_play_batch) }}" delegate_to: "{{ item }}" run_once: True @@ -108,7 +108,7 @@ - ceph_osd_container_stat.get('stdout_lines', [])|length != 0 - handler_health_osd_check | bool - hostvars[item]['_osd_handler_called'] | default(False) - with_items: "{{ groups[osd_group_name] }}" + with_items: "{{ groups[osd_group_name] | intersect(ansible_play_batch) }}" delegate_to: "{{ item }}" run_once: True