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 <dsavinea@redhat.com>
pull/6096/head
Dimitri Savineau 2020-11-30 12:15:48 -05:00 committed by Guillaume Abrioux
parent c3ed124d31
commit 1831b4955f
1 changed files with 4 additions and 5 deletions

View File

@ -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: