-
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
with_first_found will always find a task before vars in a role #14857
Comments
This is caused by the I don't really know why this behaviour is desirable so I don't know how I would go about patching this bug. It's possible that the 'patch' is really to let |
this is because first_found looks at 'all' dirs no matter what the task is, it should be more discriminatory and use 'vars' in this case and not 'files' nor 'templates' which find the match in 'tasks' before even trying 'vars' |
Ran into this problem today aswell. |
please confirm that merge above fixes this |
An exception occurred during task execution. The full traceback is: |
@eb4x that should only happen if you search for empty or null string (fixing this path now). |
under "tasks" first, instead of "vars". ansible/ansible#14857
I've created a minimal test case you can pull, https://github.com/eb4x/ansible-bug.git TASK [example : include_vars] Which makes it seem like nothing has really changed. include_vars is still pulling from tasks instead of vars directory first. |
so it worked for me cause of 'test bias', now it should work for everyone via ce282e9. |
named matched only cause i set it to the same in my tests fixes #14857
Sorry to pry but:
|
Issue Type:
Ansible Version:
Ansible Configuration:
None
Environment:
OS X
Summary:
When
with_first_found
is used to look up a file invars/
orfiles/
and a file with the same name exists intasks/
, the file intasks/
will be returned instead.Steps To Reproduce:
The galaxy role DavidWittman.filebeat exhibits this problem, as described in DavidWittman/ansible-filebeat#1. This is the relevant part of the role layout:
And here is the play:
Please bear in mind that on OS X, the default filesystem is HFS+ which is case-insensitive.
Expected Results:
vars/RedHat.yml
should be returned on a EL server.Actual Results:
tasks/redhat.yml
is returned and an error is reported (because it is not a vars file).The text was updated successfully, but these errors were encountered: