diff options
author | Matt Davis <nitzmahone@users.noreply.github.com> | 2019-10-10 21:42:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 21:42:03 +0200 |
commit | 6d52bdf4db39947327ff9584e879ed7baaa8b4b6 (patch) | |
tree | b69cfe8437881cc1b566cec5d03690500c5ec994 /test/lib/ansible_test/_internal/executor.py | |
parent | text-ify config warning message (#63349) (diff) | |
download | ansible-6d52bdf4db39947327ff9584e879ed7baaa8b4b6.tar.xz ansible-6d52bdf4db39947327ff9584e879ed7baaa8b4b6.zip |
fix default collection resolution in adhoc (#63298)
* 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
Diffstat (limited to 'test/lib/ansible_test/_internal/executor.py')
-rw-r--r-- | test/lib/ansible_test/_internal/executor.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lib/ansible_test/_internal/executor.py b/test/lib/ansible_test/_internal/executor.py index 4938b462f8..f9bc00e9a5 100644 --- a/test/lib/ansible_test/_internal/executor.py +++ b/test/lib/ansible_test/_internal/executor.py @@ -1342,6 +1342,11 @@ def command_integration_script(args, target, test_dir, inventory_path, temp_path env = integration_environment(args, target, test_dir, test_env.inventory_path, test_env.ansible_config, env_config) cwd = os.path.join(test_env.targets_dir, target.relative_path) + env.update(dict( + # support use of adhoc ansible commands in collections without specifying the fully qualified collection name + ANSIBLE_PLAYBOOK_DIR=cwd, + )) + if env_config and env_config.env_vars: env.update(env_config.env_vars) @@ -1445,6 +1450,11 @@ def command_integration_role(args, target, start_at_task, test_dir, inventory_pa env = integration_environment(args, target, test_dir, test_env.inventory_path, test_env.ansible_config, env_config) cwd = test_env.integration_dir + env.update(dict( + # support use of adhoc ansible commands in collections without specifying the fully qualified collection name + ANSIBLE_PLAYBOOK_DIR=cwd, + )) + env['ANSIBLE_ROLES_PATH'] = test_env.targets_dir module_coverage = 'non_local/' not in target.aliases |