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
archive module 'exclude_path' documentation is very misleading #34316
Comments
Files identified in the description: If these files are inaccurate, please update the |
It occurs to me of course that the issue may be that exclude_paths is supposed to mimic the behavior of tar --exclude. If that's the case, then the current documentation is essentially correct as worded, and this is a bug against how the archive module actually works. I have no idea which. |
Just sank some time into this one as well, as I was deceived by the documentation. Would definitely be up for a more clear demonstration of what this does and does not do. |
Thanks for the report. It looks like it should be fairly straight-forward to add exclusion of files and paths for tar archives using the So the simple solution is to add support for EDIT: Looking into this further, it seems that the filesystem is already being walked at the python level, so this should be pretttty easy to implement. |
I have the same issue / expectations. |
resolved_by_pr 34659 |
I'm defaulting to shell/tar, as #34659 seems stale for too long... |
is there any progress in the subject? |
Yes, I too believed the documentation and wasted time trying to work out why this option wasn't working for me. Given it seems unlikely any of the fixes will be merged, could the documentation be updated to remove the option or to mark it as broken? https://docs.ansible.com/ansible/latest/modules/archive_module.html
|
Thank you very much for your interest in Ansible. Ansible has migrated much of the content into separate repositories to allow for more rapid, independent development. We are closing this issue/PR because this content has been moved to one or more collection repositories.
For further information, please see: |
ISSUE TYPE
COMPONENT NAME
archive
ANSIBLE VERSION
CONFIGURATION
OS / ENVIRONMENT
OS X 10.12.x
SUMMARY
STEPS TO REPRODUCE
Suppose I have a directory structure that looks like this, and the following playbook:
EXPECTED RESULTS
I would expect bar.txt to be excluded from the created archive, as per http://docs.ansible.com/ansible/latest/archive_module.html : "Remote absolute path, glob, or list of paths or globs for the file or files to exclude from the archive"
ACTUAL RESULTS
bar.txt is included in the archive anyway. From the testing I've done, it appears that the ONLY thing
exclude_path
entries do is to explicitly remove-after-the-fact top level listings that were declared with wildcards inpath
.So I can do this:
NOW bar.txt isn't included in the archive I create, but its top level is not /tmp/*, it simply is 'foo', 'bar.txt', 'dir/', etc.
The way the documentation is written for the archive module, it's very easy for someone to assume that exclude_paths works the way
tar cfvz --exclude tmp/bar.txt /tmp
would, because it's never explained thatexclude_path
only operates against the list explicitly provided inpath
. What it doesn't say is the bigger problem over what it does say: I'd suggest wording more like this.exclude_path (added in 2.4): One remote absolute path or glob; or a list of absolute paths or globs, to exclude from adding to the archive, tested only against the list expanded in the
path
variable. File or directory names which do not appear in the list or expanded globs frompath
will have no effect.The text was updated successfully, but these errors were encountered: