]> git.apps.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
main: exclude client nodes from facts gathering when delegate_facts_host
authorGuillaume Abrioux <gabrioux@redhat.com>
Wed, 2 Oct 2019 13:36:30 +0000 (15:36 +0200)
committerDimitri Savineau <savineau.dimitri@gmail.com>
Mon, 30 Mar 2020 15:10:29 +0000 (11:10 -0400)
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 865d2eac9ba81bdb9ecbd841e4b73608648dfae2)

infrastructure-playbooks/rolling_update.yml
site-docker.yml.sample
site.yml.sample

index cdd9292adc835a1bd1327e777881879b427aee49..4fc784e6ec71288d3000f7c4ffc2cd1a3f49383a 100644 (file)
   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
index 7ade7d3dcb1ee433dd778c8199dbfa6958dbdab0..b9299317d59caefe2f2b9c58afee007a0a86b313 100644 (file)
   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
index e6d4159dac407255761493fa577f580bac7d740b..900f1875ad2d1f4930aa2a47b3ea5b3830fb1e1e 100644 (file)
     - 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