Skip to content

Commit

Permalink
facts.yaml: reduce the number of setup calls by ~7x (#7286)
Browse files Browse the repository at this point in the history
Before this commit, we were gathering:
1 !all
7 network
7 hardware

After we are gathering:
1 !all
1 network
1 hardware

ansible_distribution_major_version is gathered by '!all'

Signed-off-by: Etienne Champetier <[email protected]>
(cherry picked from commit fb8b075)
  • Loading branch information
champtar authored and k8s-ci-robot committed Feb 22, 2021
1 parent efd138e commit 716a66e
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions facts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,20 @@
setup:
gather_subset: '!all'

- name: Gather necessary facts
# filter match the following variables:
# ansible_default_ipv4
# ansible_default_ipv6
# ansible_all_ipv4_addresses
# ansible_all_ipv6_addresses
- name: Gather necessary facts (network)
setup:
gather_subset: '!all,!min,network,hardware'
filter: "{{ item }}"
loop:
- ansible_distribution_major_version
- ansible_default_ipv4
- ansible_default_ipv6
- ansible_all_ipv4_addresses
- ansible_all_ipv6_addresses
- ansible_memtotal_mb
- ansible_swaptotal_mb
gather_subset: '!all,!min,network'
filter: "ansible_*_ipv[46]*"

# filter match the following variables:
# ansible_memtotal_mb
# ansible_swaptotal_mb
- name: Gather necessary facts (hardware)
setup:
gather_subset: '!all,!min,hardware'
filter: "ansible_*total_mb"

0 comments on commit 716a66e

Please sign in to comment.