-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
[2.0-rc2] ansible-playbook: role with relative path don't work #13472
Comments
That's odd, this just came up the other day and it was shown to still work when it was simply the cwd ( |
I was unable to reproduce this bug using the latest devel and this playbook: foo/playbook.yml
common/tasks/main.yml
|
hi @chrrrles, can you try with https://github.com/HanXHX/ansible-nginx please? just git clone && vagrant up debian-wheezy |
@HanXHX Thanks - but I tried to do vagrant up debian-wheezy with your Vagrantfile but it fails in provisioning with:
Do you have another suggestion for testing? |
I also tried with this playbook, foo/playbook.yml:
and tasks/main.yml:
With the same results |
HI @HanXHX, is it possible that this relative path would put the role outside of the path which is mounted as |
Oh I just found something. If I run ansible-playbook as root (sudo). It works... Do you need some environment vars or something else? |
@HanXHX could you include the full output using |
With my nginx role (https://github.com/HanXHX/ansible-nginx/blob/master/tests/test.yml). As normal user, in this case it fails:
As root
In case as normal user, my role seems partially loaded. But |
With ansible 1.9.4 (as normal user):
|
oooooops... as root = ansible 1.9.4... sudo don't copy my env vars (hacking-env in git repo)... |
Yes, it seems like your role is not being loaded properly. Can you check the permissions on the files for that role? |
No problem with file permissions. |
I found the cause. When you launch a playbook, the main difference is about the current working dir :
Playbook:
Ansible 1.9.4:
On ansible 2.*:
|
Another example:
p.stdout whould be the same... |
Otherwise, each relative include path is checked on its own, rather than in relation to the (possibly relative) path of its parent, meaning includes multiple level deep may fail to find the correct (or any) file. Fixes #13472
Closing This TicketHi! We believe the above commit should resolve this problem for you. This will also be included in the next major release. If you continue seeing any problems related to this issue, or if you have any further questions, please let us know by stopping by one of the two mailing lists, as appropriate:
Because this project is very active, we're unlikely to see comments made on closed tickets, but the mailing list is a great way to ask questions, or post if you don't think this particular issue is resolved. Thank you! |
Hi,
Type: Bug Report
Ansible Version: 2.0-rc2
Environment: Xubuntu 14.04 LTS
Summary:
With Ansible 1.*, we can use relative path for roles in a playbook. I use it for testing my roles with Vagrant.
My playbook looks like
Expected Results: Run my role (like ansible 1.*)
Steps To Reproduce: You can test with one of my roles (vagrant up): https://github.com/HanXHX/ansible-nginx
Actual Results:
Cheers,
Emilien
The text was updated successfully, but these errors were encountered: