diff --git a/test/conftest.py b/test/conftest.py index ffbfaae0a2799a5afebe90b5b5f83bf76ee8b272..cd91fb5146ab59f3870929593b76ed21d5f75efb 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -54,15 +54,13 @@ def ansible_playbook_bin(): subprocess.check_call([pip_path, 'install', 'ansible', 'ansible_runner']) + # Set environment variable for a custom Ansible home + os.environ['ANSIBLE_HOME'] = venv_dir + # Add Ansible Galaxy collection galaxy_path = os.path.join(venv_dir, 'bin', 'ansible-galaxy') subprocess.check_call([galaxy_path, 'collection', 'install', - TEST_CONFIG['collection-name'], '-p', - os.path.join(venv_dir, 'collections')]) - - # Set the environment variable for the custom collections path - os.environ['ANSIBLE_COLLECTIONS_PATH'] = \ - os.path.join(venv_dir, 'collections') + TEST_CONFIG['collection-name']]) yield os.path.join(venv_dir, 'bin', 'ansible-playbook') diff --git a/test/test_playbook_utils.py b/test/test_playbook_utils.py index 7eac1952f6a0d3037b9845ed45c3ec72b309e843..7d5195674bd5f282d7ca62bcc43cbe7b89c216e0 100644 --- a/test/test_playbook_utils.py +++ b/test/test_playbook_utils.py @@ -22,7 +22,8 @@ def test_run_playbook(ansible_playbook_bin, playbook_filename): ansible_playbook_bin, '-i', 'localhost,', playbook_filename, - '--connection=local' + '--connection=local', + '-e', 'ansible_remote_tmp=/tmp' ], capture_output=True, check=False