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_fileglob
always looks up files on localhost
#34497
Comments
Files identified in the description: If these files are inaccurate, please update the |
This is the expected behavior.
To iterate a list of files on a remote node, use the If you have further questions please stop by IRC or the mailing list:
|
This information is however, nowhere to be found on the "loops" page. Everything that is stated about
(plus a warning about relative paths with roles). I still think there should be a warning/note. |
I only learned of this by reading this issue. |
Made the note clearer and instructed to use find module for remote operations. Relating to ansible#34497
Made the note clearer and instructed to use find module for remote operations. Relating to ansible#34497
ISSUE TYPE
COMPONENT NAME
with_fileglob
core built-in looping feature.ANSIBLE VERSION
CONFIGURATION
Empty
ansible.cfg
file.OS / ENVIRONMENT
SUMMARY
Looping over existing files with
with_fileglob
always looks upfilesystem entries on the controller host where Ansible is running,
and not on the target host.
STEPS TO REPRODUCE
Use the following playbook to reproduce:
Remove any local files matching the glob pattern:
Run the playbook targeting any remote host -- files
/tmp/issue-test.{foo.bar.baz}
will be created but not listed.EXPECTED RESULTS
I would expect
with_fileglob
to look up files remotely.If this is not the intended behavior, it should be clearly stated in the docs.
(Still, I would like a way to do file globs with remote files.)
ACTUAL RESULTS
Ansible expands
with_fileglob
with contents of a local file lookup.This can be seen by running the above playbook:
The text was updated successfully, but these errors were encountered: