-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
Feature: Add include option to unarchive #40522
Feature: Add include option to unarchive #40522
Conversation
The test
|
70f23af
to
d0594c9
Compare
The test
|
d0594c9
to
47f3e0f
Compare
The only thing left is adding integration tests. |
47f3e0f
to
43aaaa9
Compare
Added tests for zip archive. Need to complete for gz. |
43aaaa9
to
1bc5657
Compare
1bc5657
to
0b9491b
Compare
Added fix to tar files including tests. |
@sijis Any word on this? Writing a playbook right now that would greatly benefit from being able to whitelist the files to extract... |
LGTM though I would have use |
@@ -802,6 +822,7 @@ def main(): | |||
list_files=dict(type='bool', default=False), | |||
keep_newer=dict(type='bool', default=False), | |||
exclude=dict(type='list', default=[]), | |||
include=dict(type='list', default=[]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for taking a while to review this one! Do you mind rebasing this, updating the version added, and adding a changelog?
This option should probably be mutually exclusive with exclude
- i.e. AnsibleModule(..., mutually_exclusive=[('exclude', 'include',)])
This should allow users to extract specific files from an archive as desired. Fixes ansible#16130, ansible#27081.
- move to separate tasks file - change assertions to check for exactly one file - use remote_tmp_dir for output dir
64a8571
to
4bba39b
Compare
The test
|
This matches the behavior of exclude
@samdoran Thanks for rebasing and moving this along. |
@sijis Sorry it took us so long to merge this. Thank you for your contribution. |
SUMMARY
This should allow users to extract specific files from an archive as desired.
Fixes #16130, #27081.
ISSUE TYPE
COMPONENT NAME
unarchive
ANSIBLE VERSION
ADDITIONAL INFORMATION
Playbook
Output