pre_tasks:
- name: gather facts
setup:
- when: not delegate_facts_host | bool
+ when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
- import_role:
name: ceph-defaults
+
- name: gather and delegate facts
setup:
delegate_to: "{{ item }}"
# pre-tasks for following import -
- name: gather facts
setup:
- when: not delegate_facts_host | bool
+ when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
- name: gather and delegate facts
setup:
delegate_to: "{{ item }}"
delegate_facts: True
- with_items: "{{ groups['all'] }}"
+ with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}"
run_once: true
when: delegate_facts_host | bool
- name: gather facts
setup:
- when: not delegate_facts_host | bool
+ when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
- name: gather and delegate facts
setup:
delegate_to: "{{ item }}"
delegate_facts: True
- with_items: "{{ groups['all'] }}"
+ with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}"
run_once: true
when: delegate_facts_host | bool
# pre-tasks for following import -
- name: gather facts
setup:
- when: not delegate_facts_host | bool
+ when:
+ - not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
- name: gather and delegate facts
setup:
delegate_to: "{{ item }}"
delegate_facts: True
- with_items: "{{ groups['all'] }}"
+ with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}"
run_once: true
when: delegate_facts_host | bool
- name: gather facts
setup:
- when: not delegate_facts_host | bool
+ when:
+ - not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, [])
- name: gather and delegate facts
setup:
delegate_to: "{{ item }}"
delegate_facts: True
- with_items: "{{ groups['all'] }}"
+ with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}"
run_once: true
when: delegate_facts_host | bool