-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle custom project_dir #1222
base: devel
Are you sure you want to change the base?
Conversation
Closing and re-opening to retrigger the CI. |
Could we also add a test to verify that it works when
|
Yes sure. Thanks for the review. |
Signed-off-by: Abhijeet Kasurde <[email protected]>
If I understand it correctly, this change enforces project_dir to be under private_data_dir even if project_dir is set and is absolute path? I believe project_dir should not be forced to be under private_data_dir, because then there is no way to work around issue #1143. Consider a case: I have a runner thread that monitors a queue periodically for playbooks to run. When there's a job submitted the runner thread creates a separate unique private_data_dir for each run as well as runs the playbook. This way project_dir remains unchanged, because main ansible playbook code base resides there. The code base consists of dozens of ansible roles and playbooks. Otherwise, I would need to copy all that code into a separate private_data_dir for each playbook run which is clearly not the way I want to go. One more thing I would like to stress upon is I don't need to reuse anything dumped to filesystem. Be it envs, cmdline, passwords, etc... I handle this programmatically. That is why I also tried to set suppress_env_files=True in settings so that env is not dumped to filesystem. But it didn't work. Here's the part of runner thread code I use to run playbooks. And it works! I use ansible-runner==2.3.1, ansible==4.10.0 (ansible-core==2.11.12)
|
Quality Gate failedFailed conditions See analysis details on SonarCloud Catch issues before they fail your Quality Gate with our IDE extension SonarLint |
SUMMARY
Signed-off-by: Abhijeet Kasurde [email protected]
ISSUE TYPE
COMPONENT NAME
ansible_runner/runner.py
test/fixtures/projects/project_dir_test/env/envvars
test/fixtures/projects/project_dir_test/inventory/inv_1
test/fixtures/projects/project_dir_test/my_project/debug.yml
test/integration/test_interface.py