mirror of https://github.com/ceph/ceph-ansible.git
main: exclude client nodes from facts gathering when delegate_facts_host
This commit excludes client nodes from facts gathering, they are not
needed and can speed up this task.
Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit 865d2eac9b
)
pull/5220/head
parent
658d9cadfd
commit
cfe77bc51f
|
@ -59,19 +59,20 @@
|
|||
gather_facts: False
|
||||
vars:
|
||||
delegate_facts_host: True
|
||||
tasks:
|
||||
roles:
|
||||
- ceph-defaults
|
||||
post_tasks:
|
||||
- debug: msg="gather facts on all Ceph hosts for following reference"
|
||||
|
||||
- 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
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
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, [])
|
||||
tags: always
|
||||
|
||||
- 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
|
||||
tags: always
|
||||
|
|
|
@ -54,13 +54,13 @@
|
|||
- name: gather facts
|
||||
setup:
|
||||
when:
|
||||
- not delegate_facts_host | bool
|
||||
- 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
|
||||
|
|
Loading…
Reference in New Issue