diff options
author | Brian Coca <bcoca@users.noreply.github.com> | 2024-12-17 16:19:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-17 16:19:43 +0100 |
commit | c64c38900768ad668d118861d6f7c993b98daacb (patch) | |
tree | bd929e0ff2ac38c9c862448e1ebec72093fc1e23 /test | |
parent | uri: move follow_redirects to module_utils (#84442) (diff) | |
download | ansible-c64c38900768ad668d118861d6f7c993b98daacb.tar.xz ansible-c64c38900768ad668d118861d6f7c993b98daacb.zip |
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 <akasurde@redhat.com>
Diffstat (limited to 'test')
-rwxr-xr-x | test/integration/targets/gathering_facts/runme.sh | 6 |
1 files changed, 6 insertions, 0 deletions
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" |