ansible/files
Dag Wieers 983cdd00bc Making unarchive idempotent (#3307)
* WIP: Making unarchive idempotent

Currently unarchive is not idempotent and has many rough edges and bugs.
The current release is a workable improvement on many fronts:

- zip support is now idempotent (but gtar lacks check-mode)
- New option `exclude` to exclude specific paths/files
- New option `keep_newer` to exclude newer files on target
- New option `extra_opts` to influence unzip/gtar (like synchronize module)

The following items are still ongoing:

- Implement CRC32 support for .zip files
- Re-implement the zip support using native zipfile module
- Re-implement the gtar support using native tarfile/gzip/bz2 modules (lzma external)
- Implement check-mode (works in gzip, but fails using gtar)
- Implement diff-mode (discuss an appropriate output model, like synchronize module)

The re-implementation of unzip/gtar support using native python modules will not only simplify the codebase, additional functionality can be implemented correctly and identically, which is currently not possible. (Other archives could be implemented using native modules equally, incl. options)

* Assorted fixes to zip support (during quality checks)

- Support both rw---- and rwx--- permstr
- Better file type support (more qa needed)
- Symlink support
- Include fix from #3229

* Implement zip diff-mode (itemized change) and avoid changes permissions every time (!)

This commit implements:
- rsync-compatible itemized-change output in diff-mode (using zip)
- no longer changing permissions unconditionally (when idempotent)

* Small fixes to itemized change output

* Fixes to user/group ownership changes

- The implementation of user/group ownership is a bit more complex for idempotency
- We report when a ZIP file incorrectly tags a directory as a file/link
- We only offer diff output when there is a change

* Fix the handling of includes and excludes for unzip

* Remove test output from output (confuses easily)

* Logic and performance improvements to ownership handling, and umask fix

* Handle special files (type '?')

* Make exceptions compatible with python 2.4

* Implement CRC32 support

* Revert some unintended/unknown changes ?

* Taking over maintenance as offered by current maintainer

* Fix support for white-spaces in filenames

* Remove/rename incorrect regex

* Ensure that fat executables end up with execute permission

* Remove check_result from output when unchanged

* When unarchiving as a user, or when owner/group/mode is supplied --diff is insufficient

Only way to be sure is to check request with what is on disk (as we do for zip).
Leave this up to set_fs_attributes_if_different() instead of inducing a (false) change

* By default, don't send confusing check_results in verbose output

This fixes #74.
2016-04-18 16:31:06 -04:00
..
__init__.py package files 2014-09-26 11:05:47 -04:00
acl.py Remove duplicate documentation fields 2016-01-28 09:24:20 -08:00
assemble.py fixed exit json 2016-03-09 15:42:30 -05:00
copy.py Merge pull request #2647 from bertvv/issue_2498 2016-03-17 08:49:39 -07:00
fetch.py Add note about precautions of using become with fetch. Addresses https://github.com/ansible/ansible/issues/14064 2016-01-22 11:29:35 -06:00
file.py fixed typo, now correctly check isdir 2016-02-22 12:36:37 -05:00
find.py removed 'overquoting' of example 2016-02-12 13:24:07 -05:00
ini_file.py ini_file: added option 'noextraspaces' to turn off inserting extra spaces around '=' symbol 2016-04-13 15:50:44 +02:00
lineinfile.py Merge pull request #2896 from towolf/add_diff_to_lineinfile 2016-02-18 05:35:17 -08:00
replace.py added follow to specific modules that support it 2016-02-15 14:14:56 -05:00
stat.py Change one param to be of type path 2016-02-29 00:33:34 -08:00
synchronize.py added rsync protocol support (#1999) 2016-04-08 11:41:53 -04:00
template.py Improve doc accuracy of template module 2016-04-13 10:04:06 +08:00
unarchive.py Making unarchive idempotent (#3307) 2016-04-18 16:31:06 -04:00
xattr.py Set name to type path so that tilde and env vars are expanded 2016-02-28 23:46:40 -08:00