-
Notifications
You must be signed in to change notification settings - Fork 144
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
Save remote ansible playbooks to correct directory #3527
base: main
Are you sure you want to change the base?
Conversation
/packit build |
bf08f24
to
8855a08
Compare
@happz I noticed there is a similar issue #3237 and I tried to fix it in 8855a08. Now, remote playbooks are saved in the prepare directory inside the workdir ( |
Makes sense, it seems to be the same kind of trouble.
I'd say workdir is a good option. We can always improve |
tmt/steps/prepare/ansible.py
Outdated
|
||
if lowercased_playbook.startswith(('http://', 'https://')): | ||
assert self.step.workdir is not None # narrow type | ||
playbook_root = self.step.workdir |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As soon as self.step.workdir
appears for the second time, I'd suggest changing the normalize_*
family of functions to return both playbook root and playbook, i.e. -> tuple[Path, AnsibleApplicable]
, and most of them would return anchor_path
but normalize_remote_playbook
would return (self.step.workdir, Path(file.name).relative_to(root_path))
.
That way, the "this kind of playbook lives in step workdir" knowledge would be owned by the code responsible for processing the raw playbook path, instead of being "shared" by this code and code calling it.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea. Updated in 590b020.
8855a08
to
590b020
Compare
This PR changes the location where remote ansible playbooks are saved. Previously, they were saved in the plan's directory, but now they are saved in the workdir (
/var/tmp/tmt/...
) to ensure that tmt does not modify the plan directory.This change also resolves the issue with remote ansible playbooks not functioning correctly when used with imported plans.
Fixes: #3237
Fixes: #3349
Pull Request Checklist