Skip to content
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

Ansible prepare step of imported plan does not work #2935

Closed
mkluson opened this issue May 16, 2024 · 1 comment · Fixed by #2989
Closed

Ansible prepare step of imported plan does not work #2935

mkluson opened this issue May 16, 2024 · 1 comment · Fixed by #2989
Labels
Milestone

Comments

@mkluson
Copy link
Contributor

mkluson commented May 16, 2024

When you use import plan feature [1] and the imported plan has one of prepare steps implemented via Ansible, the execution fails, because it can not find the playbook. E.g.:
ERROR! the playbook: /var/ARTIFACTS/git-masternbv9uido/ansible/setup_to_run_leapp.yml could not be found

[1] https://tmt.readthedocs.io/en/stable/spec/plans.html#import-plans

@mkluson
Copy link
Contributor Author

mkluson commented May 22, 2024

I found out, that commenting out _ansible_playbook_path at https://github.com/teemtee/tmt/blob/main/tmt/steps/provision/__init__.py#L1474 fix this issue and does not break use case when the imported plan is run directly.

mkluson added a commit to mkluson/tmt that referenced this issue Jun 5, 2024
During `tmt run` execution there are two copies of the playbook
available:
- One in the original repository with tmt plan
- Second in the `worktree` under /var/tmp/tmt...

`_ansible_playbook_path` tries to guess absolute path to the first one.
For imported plan such path does not exists.

When `_ansible_playbook_path` is not called the second copy of the ansible playbook
(and other files from worktree) is used and the prep step works imported
plans too.

Resolves: teemtee#2935
@psss psss added this to the 1.35 milestone Jun 17, 2024
mkluson added a commit to mkluson/tmt that referenced this issue Jun 19, 2024
During `tmt run` execution there are two copies of the playbook
available:
- One in the original repository with tmt plan
- Second in the `worktree` under /var/tmp/tmt...

`_ansible_playbook_path` uses the second one instead the first one now.

Resolves: teemtee#2935
psss pushed a commit to mkluson/tmt that referenced this issue Jun 25, 2024
During `tmt run` execution there are two copies of the playbook
available:
- One in the original repository with tmt plan
- Second in the `worktree` under /var/tmp/tmt...

`_ansible_playbook_path` uses the second one instead the first one now.

Resolves: teemtee#2935
happz pushed a commit to mkluson/tmt that referenced this issue Jun 25, 2024
During `tmt run` execution there are two copies of the playbook
available:
- One in the original repository with tmt plan
- Second in the `worktree` under /var/tmp/tmt...

`_ansible_playbook_path` uses the second one instead the first one now.

Resolves: teemtee#2935
happz pushed a commit to mkluson/tmt that referenced this issue Jun 26, 2024
During `tmt run` execution there are two copies of the playbook
available:
- One in the original repository with tmt plan
- Second in the `worktree` under /var/tmp/tmt...

`_ansible_playbook_path` uses the second one instead the first one now.

Resolves: teemtee#2935
happz pushed a commit that referenced this issue Jun 26, 2024
During `tmt run` execution there are two copies of the playbook
available:
- One in the original repository with tmt plan
- Second in the `worktree` under /var/tmp/tmt...

`_ansible_playbook_path` uses the second one instead the first one now.

Resolves: #2935
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants