From da5c093ba497d4619027541da96ad20f9a1adf6c Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Tue, 30 Jun 2020 10:13:42 -0400 Subject: [PATCH] facts: explicitly disable facter and ohai By default, ansible gathers facts from facter and ohai if installed on the remote nodes, given we don't need them, let's exclude these facts from our facts gathering Signed-off-by: Dimitri Savineau (cherry picked from commit c95adc564b8be6f9f9b1ba8568072daf39da7a2c) --- infrastructure-playbooks/add-osd.yml | 8 ++++++++ infrastructure-playbooks/purge-cluster.yml | 4 ++++ infrastructure-playbooks/purge-docker-cluster.yml | 8 ++++++++ infrastructure-playbooks/rolling_update.yml | 8 ++++++++ ...om-non-containerized-to-containerized-ceph-daemons.yml | 4 ++++ site-docker.yml.sample | 8 ++++++++ site.yml.sample | 8 ++++++++ 7 files changed, 48 insertions(+) diff --git a/infrastructure-playbooks/add-osd.yml b/infrastructure-playbooks/add-osd.yml index 472190e15..17cbc38c4 100644 --- a/infrastructure-playbooks/add-osd.yml +++ b/infrastructure-playbooks/add-osd.yml @@ -26,11 +26,19 @@ - name: gather facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' when: - not delegate_facts_host | bool - name: gather and delegate facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}" diff --git a/infrastructure-playbooks/purge-cluster.yml b/infrastructure-playbooks/purge-cluster.yml index b0e3b779b..be555d505 100644 --- a/infrastructure-playbooks/purge-cluster.yml +++ b/infrastructure-playbooks/purge-cluster.yml @@ -59,6 +59,10 @@ - block: - name: get nfs nodes ansible facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups[nfs_group_name] }}" diff --git a/infrastructure-playbooks/purge-docker-cluster.yml b/infrastructure-playbooks/purge-docker-cluster.yml index 5c6cac130..b5939bcb5 100644 --- a/infrastructure-playbooks/purge-docker-cluster.yml +++ b/infrastructure-playbooks/purge-docker-cluster.yml @@ -46,6 +46,10 @@ - block: - name: get nfs nodes ansible facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups[nfs_group_name] }}" @@ -367,6 +371,10 @@ post_tasks: - name: gather monitors facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups.get(mon_group_name | default('mons')) }}" diff --git a/infrastructure-playbooks/rolling_update.yml b/infrastructure-playbooks/rolling_update.yml index 4fc784e6e..b7d0cea6c 100644 --- a/infrastructure-playbooks/rolling_update.yml +++ b/infrastructure-playbooks/rolling_update.yml @@ -66,10 +66,18 @@ - name: gather facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, []) - name: gather and delegate facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}" diff --git a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml index 87821fc18..c3ae65362 100644 --- a/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml +++ b/infrastructure-playbooks/switch-from-non-containerized-to-containerized-ceph-daemons.yml @@ -48,6 +48,10 @@ post_tasks: - name: gather and delegate facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] | difference(groups.get(client_group_name, [])) }}" diff --git a/site-docker.yml.sample b/site-docker.yml.sample index b9299317d..23c1ac6fb 100644 --- a/site-docker.yml.sample +++ b/site-docker.yml.sample @@ -24,11 +24,19 @@ pre_tasks: - name: gather facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' when: not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, []) tags: always - name: gather and delegate facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}" diff --git a/site.yml.sample b/site.yml.sample index 900f1875a..577e9d520 100644 --- a/site.yml.sample +++ b/site.yml.sample @@ -53,11 +53,19 @@ - name: gather facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' when: - not delegate_facts_host | bool or inventory_hostname in groups.get(client_group_name, []) - name: gather and delegate facts setup: + gather_subset: + - 'all' + - '!facter' + - '!ohai' delegate_to: "{{ item }}" delegate_facts: True with_items: "{{ groups['all'] | difference(groups.get('clients', [])) }}" -- 2.39.5