summaryrefslogtreecommitdiff
path: root/test/integration/targets/collections
Commit message (Collapse)AuthorAgeFilesLines
* Error for context-dependent redirects (#78755)Sloane Hertel2022-09-132-3/+15
|
* refactor and fixes for doc parsing (#77719)Brian Coca2022-09-011-1/+1
| | | | | | | | | | | | | | | * refactor and remove redundant code in documentation allow location and building api to be more accessible fix issues with displaying ansible.legacy and ansible.builtin ensure we don't x2 process tokens (some modules reference them also) fixes #77764 move to constants vs hardcoded more informative errors and comments now have actual filter/test plugins, which expose the filter/test functions moved filter/test loading/finding logic into jinja2pluginloader, removed dupe implementations added tests for case in which we unique by basename when listing Update lib/ansible/utils/plugin_docs.py Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
* Fix vars plugin code and documentation mismatch (#78562)Sloane Hertel2022-08-312-2/+8
| | | | | | | | | | | * Add a warning for collections that are attempting to be autoloaded to no effect * Deprecate REQUIRES_WHITELIST and add support for REQUIRES_ENABLED so the docs are accurate * Fix documentation * add more vars plugin tests * Simplify code and add a FIXME for another bug * fix precedence * Make setting the class attr at all a warning, even if it's True * Add fun parsing for _load_name * include _load_name in messages
* Re-organize CI test groups for POSIX tests. (#77420)Matt Clay2022-08-041-1/+1
| | | | | | * `context/target` tests must be in groups 1 - 2. * `context/controller` tests must be in groups 3 - 5. This makes it easier to efficiently organize groups and balance test runtimes.
* Fix collection redirects for filter and test plugins (#77210)Sloane Hertel2022-03-073-0/+46
| | | | | | | * Fix collection redirects for jinja2 filters/tests * Handle recursive redirects Co-authored-by: Matt Martz <matt@sivel.net>
* Use full python package for ansiballz cache filenames (#77090)Matt Martz2022-02-233-0/+21
| | | | | * Use full python package for ansiballz cache filenames * Be a little more explicit about test goals
* fix block var inheritance (#75287)Brian Coca2022-01-312-3/+3
| | | | | | * updated tests to conform to new block inheritance Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com> Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
* ansible-test pssa update and new rules (#76256)Jordan Borean2021-11-101-3/+3
|
* Require Jinja2 3.0.0 (#75881)Martin Krizek2021-10-201-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Require Jinja2 3.0.0 ci_complete * Fix sanity * Remove Jinja min/max tests * ansible-test changes * ci_complete * More cleanup ci_complete * Revert _count_newlines_from_end :( and other stuff * Fix sanity * It's using host_vars ... * Unused import * Remove overridden groupby filter * environmentfilter -> pass_environment * Explain preserve_trailing_newlines * Add changelog * ci_complete * Deprecated ANSIBLE_JINJA2_NATIVE_WARNING * native_helpers.py cleanup * More cleanup in the find intgration test
* PowerShell - Support optional module util imports (#75187)Jordan Borean2021-09-234-0/+74
|
* ansible-test - split controller/target testing (#75605)Matt Clay2021-09-201-4/+0
|
* Add a resolved_action task attribute (#74709)Sloane Hertel2021-06-2411-0/+216
| | | | | | | | | | | * The resolved_action is the formatted version of the final plugin in the PluginLoadContext's redirect_list * Collection plugins are represented as FQCN * Legacy plugins are represented with only the plugin name * Add tests * Changelog
* Fix pb subs collapse (#74301)Brian Coca2021-04-214-0/+27
| | | | | | | * fix subdir parsing for plays fixes #74283 Co-authored-by: Nikolaos Kakouros <nkak@kth.se>
* Fix a bug adding unrelated candidates to the plugin loader redirect_list ↵Sloane Hertel2021-03-184-5/+105
| | | | | | | | | | | | | | | (#73863) * Fix a bug adding unrelated candidates to the plugin loader redirect_list * Add tests for the redirect list * test redirect list for builtin module * test redirect list for redirected builtin module * test redirect list for collection module * test redirect list for redirected collection module * test redirect list for legacy module * changelog
* Allow restricting config values to enumerated list (#73162)Brian Coca2021-01-141-1/+1
| | | | | | | * Allow restricting config values to enumerated list * dont document internal entries * also ignore private defs for ansible-config * remove invalid value from tests * added porting entry
* saner path dir management (#72648)Brian Coca2020-12-141-1/+7
| | | | | | | | | * saner path dir management fixes #72628 ensure we always store paths w/o a_c Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
* Rename to ansible-core (#72594)Rick Elrod2020-11-131-1/+1
| | | | | | | | | | Change: - Initial set of changes for renaming to ansible-core - Includes changelog fragment changes from base -> core - Does NOT include docs changes - Modifies detection stuff in setup.py to support ansible<2.9 and ansible-base Test Plan: - ci_complete
* Fix task get_name to always prepend the role name (#72511)Sloane Hertel2020-11-062-1/+31
| | | | | | | * Fix 'role_name : tast_name' notation if task contains role name * Add tests for notifying handler names which contain the role name Co-authored-by: Thomas Wouters <thomaswouters@gmail.com>
* Fix fallout from #70028.Felix Fontein2020-11-021-1/+1
|
* rethink wording (#70028)Brian Coca2020-10-304-63/+11
| | | | | | | * rethink wording * removed unrequired requirement * fix tests * fixed versions Co-authored-by: Sloane Hertel <shertel@redhat.com>
* run playbook from collections (#67435)Brian Coca2020-10-282-0/+20
| | | | | | | | | | | | | * fixes for collection playbooks - add fqcn invocation, also handles extensions - bring import_playbook into new normal - avoid adding collection playbooks to adjacency - deal with extensions or lack of em - added tests - fix bugs with multiple playbooks supplied - unicode/bytes/native fixes - fix modulenotfound for < py3.7 - tests
* Ensure we call action_loader.get with collection_list (#72206)Matt Martz2020-10-193-0/+42
| | | | | | | | | | | | | * Ensure we call action_loader.get with collection_list. Fixes #72170 * Add tests and changelog * Remove grep, do assertion in playbook. ci_complete * Skip old jinja2 versions * ci_complete * dedupe
* make collection callbacks follow normal flow (#59932)Brian Coca2020-10-151-6/+6
| | | | | | | | | | | | make collections whitelist follow normal flow * fixes missing set_options call and adhoc and stdout processing rules * avoid dupes * fixed to handle redirects * also updated tests with new and more accurate skip message * fix callback tests for envs with cowsay installed * lots MOAR comments on why the code is as it is, some todos to refactor in future Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
* refactor Python module_utils locator (#70610)Matt Davis2020-07-1616-5/+117
| | | | | | | | | | | | | * refactor Python module_utils locator * no longer recursive * embed special-case module code internally * share common code between collections/not cases * fixes #70134 * properly support subpackage redirection * adds support for FQCN redirect targets used by migration (expands to FQ Python name) * add tests * add changelog
* try to load unqualified plugins from whitelist (#70086)Matt Davis2020-06-163-9/+36
| | | | | | | | | | | | | | | | | | | | | * try to load unqualified plugins from whitelist * necessary for backcompat loading of unqualified collectionized callback plugins redirected from <= 2.9 core * also added de-duping from actual loaded name * add tests * add warning test * group test script entries by topic * shorten warning text grep because wrapping is dumb * fix adhoc callback loading behavior * collections pass over whitelist wasn't respecting `_run_additional_callbacks` * adds regression tests for same * avoid `grep -L` in tests since it breaks the world
* enable collections module_utils subpkg tests (#69957)Matt Davis2020-06-152-6/+8
| | | * fixed by collection loader rewrite, just needed to be reenabled
* config: singular ANSIBLE_COLLECTIONS_PATH (#70007)James Cassell2020-06-112-4/+4
| | | | | | | | | | | | * config: singular ANSIBLE_COLLECTIONS_PATH Every other *_PATH setting in ansible is singular, and the traditional $PATH variable is also singular despite containing a list of directories. Let's be consistent both internally and with POSIX tradition. * update all ANSIBLE_COLLECTIONS_PATHS env references to be singular * deprecate plural ANSIBLE_COLLECTIONS_PATHS setting
* implemented 'prefix' for file based cache (#69872)Brian Coca2020-06-112-0/+6
| | | | | * implemented 'prefix' for file based cache Co-authored-by: s-hertel <shertel@redhat.com>
* various deprecation, display, warning, error fixes for collections ↵Matt Davis2020-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | redirection (#69822) * various deprecation, display, warning, error fixes * Update lib/ansible/utils/display.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/utils/display.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update lib/ansible/utils/display.py Co-authored-by: Felix Fontein <felix@fontein.de> * cleanup, test fixes * add collection name to deprecated() calls * clean up redirect entries from uncommitted tests * fix dep warning/error header text to match previous Co-authored-by: Felix Fontein <felix@fontein.de>
* starting metadata sunset (#69454)Brian Coca2020-06-041-0/+0
| | | | | | | | | | | | | * starting metadata sunset - purged metadata from any requirements - fix indent in generic handler for yaml content (whey metadata display was off) - make more resilient against bad formed docs - removed all metadata from docs template - remove metadata from schemas - removed mdata tests and from unrelated tests Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Rick Elrod <rick@elrod.me>
* collection routing (#67684)Matt Davis2020-05-2618-26/+306
| | | | | | | * `meta/` directory in collections * runtime metadata for redirection/deprecation/removal of plugin loads * a compatibility layer to keep existing content working on ansible-base + collections * a Python import redirection layer to keep collections-hosted (and otherwise moved) content importable by things that don't know better * supported Ansible version validation on collection loads
* Fix listing of colleciton plugins with symlinks (#69305)Brian Coca2020-05-143-1/+39
| | | | * Fix listing of colleciton plugins with symlinks
* avoid fatal tb on bad fqcn callback name (#69440)Brian Coca2020-05-131-0/+3
|
* Make sure collection is a list if a str is given (#69081)David Shrewsbury2020-04-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | * Make sure collection is a list if a str is given * Call field validation early on collections Because we are doing work on modifying the collections value before it is actually validated, we can validate it ourselves early to make sure the user supplies either a string or list. Dicts are not valid. The new validation allows us to simplify the _ensure_default_collection() function. And since the field is now static, we no longer need to specify a default for it, which also allows us to simplify the function. Since the default is now removed, we can also remove the sanity/ignore.txt entry for collectionsearch.py. New unit tests are added (and the existing one modified) that allow us to make sure that we throw a parser error if a user specifies something other than a string or list for the collections value everywhere it can be specified. * Revert removing the collection default The default is actually used, so restore it. * Fix unit tests in test_helpers.py affected by early collection validation
* Filter BLACKLIST_EXTS in PluginLoader (#69029)Rick Elrod2020-04-222-0/+6
| | | | | | | | | | | | | | | | | | | | | | | Change: Rather than hardcoding .pyo and .pyc, filter on all BLACKLIST_EXTS in the non-legacy logic of PluginLoader (_find_fq_plugin). The two harcoded extensions are part of BLACKLIST_EXTS already and this simply adds the rest of the blacklisted extensions to the check. In addition, check .endswith() instead of an exact match of the suffix, like everywhere else that uses BLACKLIST_EXTS. This allows for blacklisting, for example, emacs's backup files which can appear after any extension, leading to things like `foo.py~`. Test Plan: Ran `ansible-playbook` against a collection where a `foo.py~` module was getting executed instead of `foo.py` which also appeared in the same directory. `foo.py~` is no longer executed. Tickets: Fixes #22268 Refs #27235 Signed-off-by: Rick Elrod <rick@elrod.me>
* Allow a collection role to call a standalone role by default (#69102)Matt Martz2020-04-223-0/+13
| | | | | | | | | * Allow a collection role to call a standalone role by default. Fixes #69101 * tweaked changelog text * Guard against NoneType Co-authored-by: Matt Davis <nitzmahone@users.noreply.github.com>
* Allow tasks to notify a fqcn handler name (#68213)Matt Martz2020-04-084-0/+22
| | | | | | | | | | | * Allow tasks to notify a fqcn handler name * Add tests. Fixes #68181 * Add changelog fragment * Add test to ensure handlers are deduped properly with fqcn, role, and just handler names * Add some docs about new special vars
* fix using inventory and cache plugins in a collection (#56469)Sloane Hertel2020-03-266-8/+124
| | | | | | | | | | | | | * Allow custom inventory plugins and cache plugins If _load_name is not set correctly the cache plugin can't load the documentation (which is also the arg spec) Fix the existing inventory plugin in the collections tests Add integration tests for using a cache plugin in a collection * Set the attribute on the instance instead of the class Deprecate importing custom CacheModules directly - they should use the cache_loader
* Action module xross coll (#68080)Brian Coca2020-03-255-1/+106
| | | | | | | | | | | * added test to verify xrs collection action/module * added to runme * sanity fixes * corrected name * avoid windoez
* Address fixme and handle filter/test errors for collections better (#68047)Matt Martz2020-03-232-0/+32
| | | | | * Address fixme and handle fitler/test errors for collections better. Fixes #66721 * Re-arrange code
* Address compat issue for collection loading on py26 (#68219)Matt Martz2020-03-231-1/+0
| | | | | | | | | | | | | | | | | | | | | * Address compat issue for collection loading on py26 * Move import_module shim to utils for compat across the codebase * Enable collection tests on py2.6 * Update changelog fragment * Simplify code using sys.moduls * Move compat to module_utils/compat/importlib * Add back errantly deleted newline * Remove hack comment Co-Authored-By: Matt Clay <matt@mystile.com> Co-authored-by: Matt Clay <matt@mystile.com>
* Consolidate Windows tests to one group.Matt Clay2020-03-231-1/+1
|
* Make sorting in collection_loader match plugin loader (#65776)Sam Doran2019-12-161-0/+6
| | | | | | | | | | | | | | | | | * Simply sorting of Windows files below other plugin types Using the sort method with a custom key function uses less memory than creating multiple lists then joining them. This seemed to be an acceptable use of a lamdba, even though I geneally try to avoid them. * Fix sorting of plugins inside of collections Explicitly sort Windows files below others, mimicking what we do in plugin/loader.py * Add documentation about ansible.builtin and ansible.legacy Also document to the two different methods used for searching based on the candidate type. * Add changelog * Add integration test * Update comment with expected sort order
* Inventory CLI - Ignore settings for when vars plugins should run (#65073)Sloane Hertel2019-11-251-8/+0
| | | | | | | | | | | | * Inventory CLI - Ignore settings for when vars plugins should run and just always run them * Add note to porting guide * Fix loading vars plugins * changelog * Remove a staging test for ansible-inventory since it ignores that setting
* Support vars plugins in collections (#61078)Sloane Hertel2019-11-047-0/+318
| | | | | | | | | | | | | | | | | | | | | | | * Move var plugins handling to a separate file * Allow var plugins to require whitelisting * Add global configuration ('demand', 'start') for users to control when they execute * Add 'stage' configuration ('all', 'task', 'inventory') for users to control on a per-plugin basis when they execute * Update ansible-inventory and InventoryManager to the global and stage configuration * Update host_group_vars to use stage configuration and whitelisting * Add documentation for using new options and to the developer's guide * Add integration tests to exercise whitelisting and the new configuration options, using vars plugins in collections, and maintain backward compatibility * Changelog Co-Authored-By: Brian Coca <brian.coca+git@gmail.com> Co-Authored-By: Sandra McCann <samccann@redhat.com>
* fix default collection resolution in adhoc (#63298)Matt Davis2019-10-101-0/+4
| | | | | | | | | | | | | | * fix default collection resolution in adhoc * if an adhoc command is run with a playbook-dir under a configured collection, default collection resolution is used to resolve unqualified module/action names * Set ANSIBLE_PLAYBOOK_DIR in integration tests. * Fix config conflict in ansible integration test. * add adhoc default collection test * text-ify warning string
* allow external collections under the ansible NS (#61908)Matt Davis2019-09-053-0/+39
| | | * fixes #59988
* Collection role relative deps (#61517)Matt Davis2019-08-297-1/+73
| | | | | | | | | | | | | | | | | | | * default collection support * playbooks run from inside a registered collection will set that collection as the first item in the search order (as will all non-collection roles) * this allows easy migration of runme.sh style playbook/role integration tests to collections without the playbooks/roles needing to know the name of their enclosing collection * disable default collection test under Windows * enable collection search for role dependencies * unqualified role deps in collection-hosted roles will first search the containing collection * if the calling role has specified a collections search list in metadata, it will be appended to the search order for unqualified role deps * disable cycle detection unit test * failing on 3.7+, needs proper cycle detection * see #61527
* default collection support (#61415)Matt Davis2019-08-286-10/+103
| | | | | | | | | | | | | | | | | | | | | | | | | * default collection support * playbooks run from inside a registered collection will set that collection as the first item in the search order (as will all non-collection roles) * this allows easy migration of runme.sh style playbook/role integration tests to collections without the playbooks/roles needing to know the name of their enclosing collection * ignore bogus sanity error * filed #61460 * fixed task unit test failure * don't append an empty collections list to the ds * ignore leftover local_action in mod_args ds action parsing * fix async_extra_data test to not require ssh and bogus locale * disable default collection test under Windows * ensure collection location FS code is always bytes * add changelog
* Change collection PS util import pattern (#61307)Jordan Borean2019-08-279-18/+57
| | | | | | | | | | | | | | * Change collection PS util import pattern * Add changes for py2 compat * fix up regex and doc errors * fix up import analysis * Sanity fix for 2.6 CI workers * Get collection util path for coverage collection