when:
- keys_tmp is defined
+# dummy container setup is only supported on x86_64
+# when running with containerized_deployment: true this task
+# creates a group that contains only x86_64 hosts.
+# 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] }}"
+ when:
+ - (hostvars[item]['ansible_architecture'] == 'x86_64') or (not containerized_deployment)
+
- name: run a dummy container (sleep 300) from where we can create pool(s)/key(s)
command: >
docker run \
changed_when: false
when:
- containerized_deployment
- - inventory_hostname == groups.get(client_group_name) | first
+ - inventory_hostname == groups.get('_filtered_clients') | first
- name: set_fact delegated_node
set_fact:
when:
- cephx
- keys | length > 0
- - inventory_hostname == groups.get(client_group_name) | first
+ - inventory_hostname == groups.get('_filtered_clients') | first
- name: slurp client cephx key(s)
slurp:
when:
- cephx
- keys | length > 0
- - inventory_hostname == groups.get(client_group_name) | first
+ - inventory_hostname == groups.get('_filtered_clients') | first
- name: list existing pool(s)
command: >
delegate_to: "{{ delegated_node }}"
when:
- condition_copy_admin_key
- - inventory_hostname == groups.get(client_group_name, []) | first
+ - inventory_hostname == groups.get('_filtered_clients', []) | first
- name: create ceph pool(s)
command: >
when:
- pools | length > 0
- condition_copy_admin_key
- - inventory_hostname in groups.get(client_group_name) | first
+ - inventory_hostname in groups.get('_filtered_clients') | first
- item.1.rc != 0
- name: get client cephx keys
owner: "{{ ceph_uid }}"
group: "{{ ceph_uid }}"
with_items:
- - "{{ hostvars[groups[client_group_name][0]]['slurp_client_keys']['results'] }}"
+ - "{{ hostvars[groups['_filtered_clients'][0]]['slurp_client_keys']['results'] }}"
when:
- not item.get('skipped', False)