Support running the tests with ANSIBLE_GATHERING=explicit

Almost all the network role tests fail with fact gathering disabled.
Therefore, in order to support the tests running with
ANSIBLE_GATHERING=explicit, gather the minimum subset of facts
required.

Signed-off-by: Wen Liang <liangwen12year@gmail.com>
This commit is contained in:
Wen Liang 2023-01-09 15:15:46 -05:00 committed by Fernando Fernández Mancera
parent 592fab52a5
commit c526da39c7

View file

@ -1,4 +1,17 @@
# SPDX-License-Identifier: BSD-3-Clause
- name: Gather the minimum subset of ansible_facts required by the network
role test
setup:
gather_subset: min
when: not ansible_facts.keys() | list |
intersect(network_test_required_facts) == network_test_required_facts
vars:
network_test_required_facts:
- distribution
- distribution_major_version
- distribution_version
- os_family
- name: Fix CentOS6 Base repo
copy:
dest: /etc/yum.repos.d/CentOS-Base.repo