Commit Graph

607 Commits (c3c964475c073f0ad45685b65dbc79721c30807d)

Author SHA1 Message Date
Brian Coca 1d4c0abe29 added backup_file to module returns (#4723)
fixes #14502
also cleaned up some unused stuff and fixed imports
8 years ago
Dag Wieers dfb170cab9 Support DOS file attributes (e.g. archive-bit or hidden-bit) (#4705)
This fixes #4554
8 years ago
Evan Kaufman f7b34c810a Declare empty diff dict ahead of time (#4646)
Fixes #4634
8 years ago
Toshio Kuratomi 42c74a0ce2 Python3 fixes to copy, file, and stat so that the connection integration tests can be run (#4632)
* Python3 fixes to copy, file, and stat so that the connection integration tests can be run

* Forgot to audit the helper functions as well.

* Fix dest to refledt b_dest (found by @mattclay)
8 years ago
Toshio Kuratomi 7e79c59d38 to_text, to_bytes, and to_native now have surrogate_or_strict error handler (#4630)
On python3, we want to use the surrogateescape error handler if
available for filesystem paths and the like.  On python2, have to use
strict in these circumstances.  Use the new error strategy for to_text,
to_bytes, and to_native that allows this.
8 years ago
Evan Kaufman 5728ef89f0 Implemented file content diff for replace module (#4479) 8 years ago
James Pharaoh 5bce0049a1 fix error in documentation for stat checksum (#4582) 8 years ago
Gennady Trafimenkov 6ac58a5832 Clarify what checksum algorithm is used by copy modules (#4198) 8 years ago
Toshio Kuratomi 4912ec30a7 Fixes for lineinfile (#4553)
Lineinfile deals heavily with Unic text files.  Makes some sense to deal
with it all as byte strings.  So there is a lot of work done here to
show that we're dealing with byte strings throughout.
8 years ago
Dag Wieers 9ea56d26b0 Fix multiple issues with unzip and gtar support (#4131)
* Improve the correct handling of gtar and unzip options

Add the option --show-transformed-names when extra_opts is being used
Ignore bogus warnings related to empty filenames
Properly quote _and_ escape filenames for unzip command
Rewrite gtar options and provide run_command with array, not string

This fixes #2480 and #4109.

* Make check-mode work for zip-files

Check-mode was disabled for zip-files since gtar did not support it.
This change enables check-mode support for zip-files, but does skip the task when used with gtar.
(Best of both worlds)

Also remove unused compress_mode variable.

This replaces PR #4401, the changes overlap somewhat so I merged them
8 years ago
Michael Scherer f6450e577f Add acl freebsd (#3656)
* FreeBSD do not support --omit-header and --absolute-names

* The option for following symlink wth getfacl is different on FreeBSD

* ZFS on Freebsd use nfsv4 acls, who use a slightly different syntax

* FreeBSD do not have a --test flag, so always return 'True'

* FreeBSD do not have the --omit-headers options, so we have to filter by ourself

* Mark Freebsd as working for the acl module
8 years ago
Toshio Kuratomi 90673cf6db Refactor stat.py so that it would be more friendly for unittests. (#4462)
* Refactor stat.py so that it would be more friendly for unittests.

* PEP8ify since we're moving most of the lines in the file and there's no open PRs
8 years ago
Chris Short 013e91e9b0 find.py: Editing contains description to say regex (#4452)
find module contains argument appears to accept regex; correcting description accordingly
8 years ago
Lucas Costa Beyeler 5559e6a669 Fix #4202: Can't unarchive remote files (#4244)
When you try to remote unarchive files with the option copy=no the code always fail, as evidenced in issue #4202. That happens because the conditional to check "if remote_src=no or copy=yes" will always be true since the default value of them is remote_src=no and copy=yes.
My modification is only to change the condition from or to and, that way only if both the vars stay with the default value will be true, otherwise you can unarchive remote files.
8 years ago
Dag Wieers 4fddb21980 Improve the documentation (#4385)
Improvements to make it more clear that pure compressed files (.gz, .bz2 and .xz) files are not supported.

This improves on #3241.
8 years ago
Sam Doran 06e9dc5236 Improve regexp for matching file permissions (#4306)
A capital "S" appears when the the setuid or setgid bit are set but have no effect. Likewise, a capital "T" appears when the sticky bit is set but it has no effect.
8 years ago
Brian Coca 9dde201d87 unsafe writes! (#4314)
* unsafe writes!

* moved unsafe_write docs and args to file common

* added unsafe_writes option handling
8 years ago
Toshio Kuratomi 5d7b46e0dd Be explicit about specifying the ssh port if it was user specified (#4302)
Previously, if the port specified by the user or inventory was 22, then
the ssh client port would be used instead.

Fixes #3895
8 years ago
peter.jang caaa8e282e fix for rsync protocol (#4211) 8 years ago
David Chwalisz afff84321d file module: add clarification on state=absent re files that do not exist. 8 years ago
Brian Coca 7de287237f stop trying to set permissions in check mode
fixes #4195
8 years ago
Ryan S. Brown 3a04ec5a70 Indent `unarchive` module documentation to fix parsing error. 8 years ago
James Cammarata bfeab3ae1a Merge branch 'feature_10218' into devel 8 years ago
tobixx 3139b90f7e added read-/write-/executeable flags for invoking user (#4130) 8 years ago
James Cammarata 467516e5da Add remote_src param for unarchive to deprecate `copy` param
From ansible/ansible#10218
8 years ago
Dag Wieers 37b7708c5d Fix a problem where the newly provided mode is a string (#3769)
* Fix a problem where the newly provided mode is a string

This fixes #3597

* Implement python3-compatible get_exception() handling
8 years ago
Dag Wieers b66bf8e7a4 Revert PR #3575 since it causes problems related to exclude patterns (#3767)
* Revert PR #3575 since it causes problems related to exclude patterns

By using a different method for getting archive filelists, and extracting we introduced new problems related to excluding based on gtar patterns.

As a result files that would be excluded by gtar, would still be in the filelist. Implementing our own gtar compatible pattern exclusion mechanism is near to impossible (believe me, we looked at it...). The best way is to look at the original problem and deal with that, and ensure that extraction and filelists are done with the exact same tool and exact same options.

The solution is to decode the octal unicode representation in gtar's output back to unicode. Since gtar has no problem extracting these files in LANG=C, we simply has to compensate for it.

This reverts #3575 and fixes #11348.

* Implement codecs.escape_decode() instead of decode("string_escape") for python3
8 years ago
Lukas Grossar 49bf8de27c also match on tabs in ini_file (fixes #106) (#4067)
also match on tabs in ini_file
8 years ago
Toshio Kuratomi 41adb78cab A few more sanity checks for detecting unzip output that's not a file entry (#3982)
* A few more sanity checks for detecting unzip output that's not a file entry

Also note that there's a rounding error somewhere in the mtime
comparison code.

* Fix reference to sub-array
9 years ago
Keisuke Kamada 74864c2d85 Do not copy file if running on check mode 9 years ago
Brian Coca 949916a155 restored incorrectly removed docs, jinja2 override 9 years ago
neo 606598a857 fix unarchive doesn't extract changed tar file #3901 9 years ago
Matt Fischer 1f5335d5e0 Update delete notes for Synrhconize docs (#3723)
The example for delete=yes does not specify recursive although it is
required. In addition, the wording for the delete option is confusing
about from where files are really deleted. This should clarify that.
9 years ago
Dag Wieers 3f7a935932 Improve the unzip output scraping (#3819)
* Improve the unzip output scraping

Ensure we capture the complete file (also when it includes spaces).
Drop lines that do not conform (in length) to what we expect (e.g. header/footer).

This fixes #3813

* Fix how split() works
9 years ago
Brendan Jurd 6448204271 Fix grammar in docs for fetch 'fail_on_missing' (#3872) 9 years ago
Brian Coca b8598748bc Revert "Add prefixing and suffixing fuctionality to assemble"
This reverts commit 4c386dba56.
keeping in sync with main repo revert
9 years ago
Matthias Frey d3a9a90d2d Fixed error in assemble module when validation failed. (#3814)
Error was: TypeError: fail_json() takes exactly 1 argument (2 given)
9 years ago
Chris Houseknecht ca4365b644 Merge pull request #901 from underyx/assemble-with-prefix-and-suffix
Add prefixing and suffixing fuctionality to assemble module
9 years ago
Bence Nagy 4c386dba56 Add prefixing and suffixing fuctionality to assemble 9 years ago
Jan Fader 7c08f10900 fix for #3706 (#3778) 9 years ago
Dag Wieers 9f973aefb1 Add unpack results to error output, for debugging purposes on failure
This may help understand what is going on with #3631
9 years ago
Toshio Kuratomi ca4140134d Python2.4's zipfile library cannot handle zip 64bit extensions which are needed for > 64K files (#3754)
Fallback to unzip if zipfile fails and hope that unzip can deal with it
(sites have an easier time upgrading the unzip utility than all of
python).

https://bugs.python.org/issue3997

Fixes #3560
9 years ago
Marcos Diez 9e197a5f78 The documentation of lineinfile now makes reference to blockinfile (#3639) 9 years ago
Michael Scherer 69ea617093 Convert the whole files/ directory to py3 syntax (#3685) 9 years ago
Michael Scherer de6cdeeba6 Testing the module on freebsd fail, since module is not assigned yet 9 years ago
Michael Scherer 2449267d42 Fix the argument for acl module (#3653) 9 years ago
Dag Wieers 83a3c45a7d Fix small typo (#3642) 9 years ago
Veaceslav Mindru 430e3eeebd add vlidate_certs option for unarchive module (#2635) 9 years ago
Toshio Kuratomi 4a8a292793 bytearray isn't available in python2.4 (#3583)
* Detection of handler depends on the wrong handler failing to list the contents of the tarfile.

Use explicit compression types with the python tarfile library to
achieve that.

* bytearray isn't available in python2.4
9 years ago
Toshio Kuratomi 0ec3b06208 Detection of handler depends on the wrong handler failing to list the contents of the tarfile. (#3584)
Use explicit compression types with the python tarfile library to
achieve that.
9 years ago