mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
2ef8b297ff
* Fix loading namespaced doc_fragments The syntax for specifying a different fragment name was already using '.' as a separator, so the code needed to be tweaked to avoid choking on names like `testns.testcoll.fragname` and `testns.testcoll.fragname.altvar`. `get_plugin_class()` returns 'docfragment' for the fragment loader; mangling `subdir` provides consistent alignment with the normal plugin directory names and avoids needing special handling of plugin types with 'module' in the name. * Add changelog entry
34 lines
1.1 KiB
Bash
Executable file
34 lines
1.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -eux
|
|
|
|
export ANSIBLE_COLLECTIONS_PATHS=$PWD/collection_root_user:$PWD/collection_root_sys
|
|
export ANSIBLE_GATHERING=explicit
|
|
export ANSIBLE_GATHER_SUBSET=minimal
|
|
export ANSIBLE_HOST_PATTERN_MISMATCH=error
|
|
|
|
# FIXME: just use INVENTORY_PATH as-is once ansible-test sets the right dir
|
|
ipath=../../$(basename "${INVENTORY_PATH}")
|
|
export INVENTORY_PATH="$ipath"
|
|
|
|
# temporary hack to keep this test from running on Python 2.6 in CI
|
|
if ansible-playbook pythoncheck.yml | grep UNSUPPORTEDPYTHON; then
|
|
echo skipping test for unsupported Python version...
|
|
exit 0
|
|
fi
|
|
|
|
# test callback
|
|
ANSIBLE_CALLBACK_WHITELIST=testns.testcoll.usercallback ansible localhost -m ping | grep "usercallback says ok"
|
|
|
|
# test documentation
|
|
ansible-doc testns.testcoll.testmodule -vvv | grep -- "- normal_doc_frag"
|
|
|
|
# we need multiple plays, and conditional import_playbook is noisy and causes problems, so choose here which one to use...
|
|
if [[ ${INVENTORY_PATH} == *.winrm ]]; then
|
|
export TEST_PLAYBOOK=windows.yml
|
|
else
|
|
export TEST_PLAYBOOK=posix.yml
|
|
fi
|
|
|
|
# run test playbook
|
|
ansible-playbook -i "${INVENTORY_PATH}" -i ./a.statichost.yml -v "${TEST_PLAYBOOK}"
|