]> 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)
committerGuillaume Abrioux <gabrioux@redhat.com>
Mon, 7 Oct 2019 09:21:23 +0000 (11:21 +0200)
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/add-mon.yml
infrastructure-playbooks/docker-to-podman.yml
infrastructure-playbooks/rolling_update.yml
site-container.yml.sample
site.yml.sample

index bfd91995ecaaf8d7bf2dedef60acfb8483d5203f..ae561862cc613b6defc8e60a8a3609aecae01db1 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, [])
     - import_role:
         name: ceph-defaults
+
     - name: gather and delegate facts
       setup:
       delegate_to: "{{ item }}"
index 861d95704530d260786cdbad9698562e3066effe..2d997a488df23fefd2dd38ea2f9f36aaabf23905 100644 (file)
     # 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
 
index 9e13ad8ed502c508a1797515ac794013e2434bb9..7953ed6201fcf7ba1338c33fd12bc09eeab5f04e 100644 (file)
 
     - 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 204cf771ed7a3e90968ec10f555cb6f1d2430366..59efb62ac18675dfc4544d751001a4a44bbaeeef 100644 (file)
     # 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
 
index 44e19aad7701086485b2509fb25399858623e13d..fe7876f6233175551c420e398212fc923d9e7dbe 100644 (file)
 
     - 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