From c64c38900768ad668d118861d6f7c993b98daacb Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Tue, 17 Dec 2024 10:19:43 -0500 Subject: gather_facts, fix 'smart' handling with network os and 'setup' (#84425) gather_facts, fix network_os and smart logic and defaults setup will be default for smart only if network_os is not set, now you get warnings and errors when missing a valid facts module for a network os Co-authored-by: Abhijeet Kasurde --- test/integration/targets/gathering_facts/runme.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'test') diff --git a/test/integration/targets/gathering_facts/runme.sh b/test/integration/targets/gathering_facts/runme.sh index ace83aa2ef..b1d2e8abb0 100755 --- a/test/integration/targets/gathering_facts/runme.sh +++ b/test/integration/targets/gathering_facts/runme.sh @@ -39,4 +39,10 @@ ANSIBLE_FACTS_MODULES='ansible.legacy.slow' ansible -m gather_facts localhost -- # test parallelism ANSIBLE_FACTS_MODULES='dummy1,dummy2,dummy3' ansible -m gather_facts localhost --playbook-dir ./ -a 'gather_timeout=30 parallel=true' "$@" 2>&1 +# ensure we error out on bad network os +ANSIBLE_FACTS_MODULES='smart' ansible -m gather_facts localhost -e 'ansible_network_os="N/A"' "$@" 2>&1 | grep "No fact modules available" + +# ensure we warn on setup + network OS +ANSIBLE_FACTS_MODULES='smart, setup' ansible -m gather_facts localhost -e 'ansible_network_os="N/A"' "$@" 2>&1 | grep "Detected 'setup' module and a network OS is set" + rm "${OUTPUT_DIR}/canary.txt" -- cgit v1.2.3