From 1831b4955f7f83d2375bda5260331fc052bad39d Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Mon, 30 Nov 2020 12:15:48 -0500 Subject: [PATCH] ceph-client: use group_by instead of add_host Instead of iterate over all client nodes with a loop sequentially, we can use the group_by ansible buildin. Signed-off-by: Dimitri Savineau --- roles/ceph-client/tasks/create_users_keys.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/roles/ceph-client/tasks/create_users_keys.yml b/roles/ceph-client/tasks/create_users_keys.yml index e6c53a01e..b6cdf6c27 100644 --- a/roles/ceph-client/tasks/create_users_keys.yml +++ b/roles/ceph-client/tasks/create_users_keys.yml @@ -5,11 +5,10 @@ # when running with containerized_deployment: false this task # will add all client hosts to the group (and not filter). - name: create filtered clients group - add_host: - name: "{{ item }}" - groups: _filtered_clients - with_items: "{{ groups[client_group_name] | intersect(ansible_play_batch) }}" - when: (hostvars[item]['ansible_architecture'] == 'x86_64') or (not containerized_deployment | bool) + group_by: + key: _filtered_clients + parents: "{{ client_group_name }}" + when: (ansible_architecture == 'x86_64') or (not containerized_deployment | bool) - name: set_fact delegated_node set_fact: