From 070db68ffd330908b15aa47d02f4326fa4b4121e 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 72ee60462..17c44b682 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 - 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 @@ -109,7 +109,7 @@ - ceph_osd_container_stat.get('stdout_lines', [])|length != 0 - handler_health_osd_check - 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 -- 2.39.5