Commit Graph

602 Commits (958d894c6119cee6a976c5663156ee789bfcf239)

Author SHA1 Message Date
Charles Ferguson 9325c0ae5f Update documentation for 'file' module to include 'diff_peek'.
The 'diff_peek' option isn't documented at all, and provides a
rudimentary check that the content isn't binary. Documentation is
added to explain the option.

The 'validate' option has a declaration, but isn't implemented.
Therefore it may as well be removed from the module.
9 years ago
Charles Paul 1bc0b6ee6a create non-existent ini file
fixing fail_json

more verbose fail msg
9 years ago
Maarten Claes e9c548da41 This fixes copy with the remote_src option
It was broken in 6e37f1dcef when the remote_src was added. Need to
pass the absolute path to copy2 instead of a tuple.
9 years ago
Brian Coca 6e37f1dcef fixed remote_src support, now actually copies and does not move 9 years ago
Timothy Appnel ca12ed5d98 Added the checksum_algo alias to the stats module. 9 years ago
Brian Coca e74dc8c1dd minor doc fixes 9 years ago
Ales Nosek 22790d301a Make the syntax work with Python 2.4 9 years ago
Ales Nosek 7f59773460 ini_file should only change what was specified and nothing more #5860
See also:
http://alesnosek.com/blog/2015/08/03/improving-ansibles-ini-file-module/
9 years ago
Brian Coca 45a9f0b453 since find doesn't make changes, support check mode and gather data for other tasks in check mode 9 years ago
Toshio Kuratomi 3993f4e967 Simplify logic to handle options set to empty string
Fixes #2125
9 years ago
Brian Coca 87b8086163 Merge pull request #2327 from ryansydnor/devel
Add capability for stat module to use more hash algorithms
9 years ago
Brian Coca 486d233cbe Merge pull request #2262 from bcoca/find_regex
added regex support to find
9 years ago
Ryan Sydnor fb10161510 Add capability for stat module to use more hash algorithms
Specifically, the stat module now has a checksum_algorithm parameter.
This lets the module utilize one of the hash algorithms available on the host
to return the checksum of the file.

This change is backwards compatible. The checksum_algorithm defaults to
sha1 and still returns its result to the stat.checksum property.
9 years ago
Brian Coca 2b33c92e7a corrected docs for stat's lnk_source
fixes #12850
9 years ago
Brian Coca 074aad23e7 final form, use_regex now controls if patterns is glob or regex
- fixed cases in which stat fails (dangling symlink)
- now properly reports name of skipped paths
9 years ago
Brian Coca e603b1bb69 changed so regexes and shell globs work transparently 9 years ago
Brian Coca fdd88863d4 fixed bug in spec 9 years ago
Brian Coca bc4b40d8e7 added regex support to find, also added 'singular' aliasess to patterns and paths 9 years ago
Brian Coca 5893eb51a5 documented new remote_src option 9 years ago
varnav 07c5143a99 Fixed confusion in the docs
As 'path' is actually alias for 'dest', this could be confusing.
9 years ago
Toshio Kuratomi e9139ba4fa Change the example of rsync_opts to use a list instead of a string
Fixes #9889
9 years ago
James Cammarata 22d25de23c Fix syntax error in synchronize docstring 9 years ago
James Cammarata 627bd47fd3 Merge pull request #2055 from skylerbunny/patch-1
Explanation of privilege escalation in notes
9 years ago
Brian Coca f12a2135ca Merge pull request #1525 from mjuenema/devel
Removed check whether destination directory is writable from files/un…
9 years ago
skylerbunny 489f3e67f1 Explanation of privilege escalation in notes
An attempt to make clear how privilege escalation works with respect to the src/source host and dest/destination host. One existing note was incorporated into three new ones, iterating each.
9 years ago
James Cammarata 310cf77edc Merge pull request #1947 from astorije/astorije/fix-acl
Fix the acl module
9 years ago
Brian Coca 68ab025dac minor doc fixes 9 years ago
Jérémie Astori 72fb7a0a17 Fix physical walk on acl module for Linux
`-h` is for BSD [1] while `-P`/`--physical` is for Linux [2].
This commit fixes that option now that acl module is (temporarily)
only supported for Linux.
I will re-add `-h` when fixing BSD support.

[1]: http://www.freebsd.org/cgi/man.cgi?format=html&query=setfacl(1)
[2]: http://linuxcommand.org/man_pages/setfacl1.html
9 years ago
Jérémie Astori 8eefd44aef Make sure entry is not sent when acl state=query 9 years ago
Jérémie Astori 0e659ad872 Make sure permission-less entries are accepted when state=absent
Also, remove that try condition as, at that stage, no permissions with
other than 2 or 3 fields are sent to the function.
9 years ago
Jérémie Astori e95bcaeb8a Remove support for `d[efault]:` in entry permissions
It is not documented in [the Ansible doc page][1] nor
[the BSD setfacl man entry][2] (which means it might not be compatible
with BSD) so removing it does not break the API.

On the other hand, it does not conform with POSIX 1003.1e DRAFT
STANDARD 17 according to the [Linux setfacl man entry][3] so safer to
remove.

Finally, the most important reason: in non POSIX 1003.e mode, only ACL
entries without the permissions field are accepted, so having an
optional field here is very much error-prone.

[1]: http://docs.ansible.com/ansible/acl_module.html
[2]: http://www.freebsd.org/cgi/man.cgi?format=html&query=setfacl(1)
[3]: http://linuxcommand.org/man_pages/setfacl1.html
9 years ago
Brian Coca f925f7e01f Merge pull request #1734 from freym/assemble-file-validation
assemble: add file validation support.
9 years ago
Jérémie Astori 3ac990556d Fix wrong expectation regarding entry format in acl module 9 years ago
Jérémie Astori 421d3f12cf Fix wrong processing of lines returned by setfacl in test mode 9 years ago
Jérémie Astori 50c6425673 Fix minor whitespace issues 9 years ago
Brian Coca d61fde42ef updated encoding comment and expanded authors field 9 years ago
Brian Coca d4a39d23df Merge pull request #150 from astorije/recursive_acl
Add recursive support for ACL module
9 years ago
Jérémie Astori acfc2166b0 Set version number in recursive option description 9 years ago
Jérémie Astori f8027a7f0a Ensure Python 2.4 compatibility and Linux-restricted support
- Make build_entry compatible with Python 2.4
- Re-add missing warning/comment that was forgotten while refactoring
- Replace `all()` with a good ol' for-loop Python 2.4 compatibility
- Make a condition check more explicit (when `state` is `query`)
- Make sure this module can only be run with on a Linux distribution
- Add a note about Linux-only support in the documentation
- Set the version in which recursive support was added, 2.0
9 years ago
Marius Gedminas 9bcf69a155 Fix obvious copy-paste error in module docs 9 years ago
Toshio Kuratomi f39e5ffa1d Modify the default for synchronize's dest_port again 9 years ago
Toshio Kuratomi ed2d8121b3 Update docs to reflect precedence for synchronize's dest_port param 9 years ago
Toshio Kuratomi 0071fd0bf7 Allow mode as a synchronize parameter (handled in action plugin) 9 years ago
Brian Coca 697307f88c Merge pull request #1670 from mikeputnam/issue-1643-gpl-header
Add missing GPLv3 License header
9 years ago
Toshio Kuratomi 19741d75eb Fi the local_rsync_path parameter used by the action plugin 9 years ago
James Cammarata 2bfddb015d In copy, set the mode before running th validation
Because some programs that do validation (like visudo) may require
the permissions to be more restricted.

Fixes ansible/ansible#11385
9 years ago
Brian Coca 9b8470ae95 minor doc fixes 9 years ago
Brian Coca c688408385 fixed fragment docs 9 years ago
Jeff Widman fd6518179b Move validate command into doc fragment and fix a few typos 9 years ago
Brian Coca 46fa43d9e0 Merge pull request #988 from isaacsimmons/ini-file-catch-interpolation-error
Handle ini file properties that contain interpolation errors
9 years ago
Patrik Lundin 3849a6d87b synchronize: add flag for verifying target host.
Add the possibility to verify the target host using a "verify_host"
flag. It is disabled by default to not change the module behaviour.
9 years ago
Brian Coca 2e77041dae Merge pull request #1654 from bcoca/file_dir_exceptions
now captures any exceptions when trying to create directories
9 years ago
Matthias Frey 68a3c6ece4 assemble: add file validation support. 9 years ago
Brian Coca e916b04e91 Also document in example that unarchive download was added in 2.0 9 years ago
Mitchell Ludwig 9e11f5fd15 Improved stat documentation 9 years ago
Brian Coca e33f093075 added ignore hidden to assemble 9 years ago
Jérémie Astori ae1126c217 Add recursive support for ACL module (fix #5053, fix #5550, fix #7276) 9 years ago
Mike Putnam 6c0e264806 Add missing GPLv3 License header
Fixes #1643
9 years ago
Brian Coca 37506141a3 Merge pull request #1613 from verm666/issue-1575
unarchive: fix work with 0 bytes archives
9 years ago
Brian Coca ed179fe379 now captures any exceptions when trying to create directories 9 years ago
Matthew Gilliard 910728f6c3 Handle race condition in directory creation.
If we try to make a directory, but someone else creates the directory
at the same time as us, we don't need to raise that error to the user.
They asked for the directory to exist, and now it does. This fixes
the race condition which was causing that error to be raised, and
closes #1648.
9 years ago
verm666 8deee99fcc unarchive: fix @bcoca's remarks, issue #1575 9 years ago
Brian Coca 433ca93c42 Merge pull request #1605 from vladimirmartsul/patch-1
Add "force" description
9 years ago
Brian Coca 13116d8ac0 Merge pull request #839 from gimoh/patch-1
Do not insert extra newline if line already contains it
9 years ago
verm666 725a7b2f59 unarchive: fix work with 0 bytes archives
This change is in response to issue #1575
9 years ago
Toshio Kuratomi a5bba2488f Update version_added to 2.0 for the partial option 9 years ago
Vladimir Martsul 2206477b73 Add "force" description
Add "force" option description
9 years ago
Juan Picca 892212b9c4 synchronize module: add partial option 9 years ago
Toshio Kuratomi c5324f54e6 Bump amount of file to download in a chunk to 64k. 9 years ago
Toshio Kuratomi daa1472ccf Merge pull request #1448 from Jmainguy/unarchive_http
add download ability to unarchive module
9 years ago
Jonathan Mainguy 58ef71fc84 add download ability to unarchive module 9 years ago
Ritesh Khadgaray 81528e6834 Add the ability to grep for content 9 years ago
Markus Juenemann 0db3206cae Removed check whether destination directory is writable from files/unarchive.py.
This check will prevent extraction of an archive if the archive does not
actually write to the destination directory but only writes to any writable
sub-directories of it. The underlying tar command will report errors
should it try to write to read-only directories.
9 years ago
Greg DeKoenigsberg 2a5f0bde87 Proper author info for all remaining modules 9 years ago
Tristan Fisher fa9d2f56df removes bool type from validate. 9 years ago
Tristan Fisher 98061a8f33 standardizes bools in argument_spec 9 years ago
jaypei 823adbbe36 use the right way to unescape line string
Reference https://github.com/ansible/ansible/issues/10864
9 years ago
Brian Coca 898f47e557 stat doc fix
fixes #1371
9 years ago
Greg Taylor f38bf24c8a Adding directory creation example to file module. 9 years ago
Brian Coca 37532628c0 minor docfix 9 years ago
Brian Coca e08eb7d7bc Merge pull request #1341 from tfishersp/devel
standardizes bools in argument_spec
9 years ago
Tristan Fisher 90b34e2b67 removes bool type from validate. 9 years ago
Toshio Kuratomi 81b476cd02 Update module "imports" to new style
Fixes #1351
9 years ago
Toshio Kuratomi 4b44aa4799 Fix use of codecs.escape_decode() 9 years ago
Toshio Kuratomi 142760658f Slightly more future-proof version of the lineinfile fix 9 years ago
Toshio Kuratomi 2eafbdd63a Merge branch 'fix-lineinfile' of https://github.com/jaypei/ansible-modules-core into jaypei-fix-lineinfile 9 years ago
Toshio Kuratomi 493144e06c Correct lineinfile documentation about double quoting... Hasn't been the case for years. 9 years ago
Tristan Fisher db292e08b9 standardizes bools in argument_spec 9 years ago
Jason Paige 72e5e3a17a update flat description
default behavior is to append the `hostname/path/to/file`, not prepend as currently stated by the flat arg docs
10 years ago
Brian Coca 9a2e64b76d generic fix for Exceptions that heppen when trying to set permissions on extracted files
fixes ansible/ansible#10934 which is really a corner case
10 years ago
Ryan Hartkopf 06e2dcc108 synchronize: don't add ssh_args to ssh_opts when false or null 10 years ago
jaypei fb34842a05 use the right way to unescape line string
Reference https://github.com/ansible/ansible/issues/10864
10 years ago
Brian Coca c323ef9233 Merge pull request #1073 from sivel/sync-ssh-args
Add ability to specify using ssh_args in synchronize
10 years ago
Brian Coca 724b848c61 Merge pull request #1025 from bcoca/find
1st draft find module
10 years ago
Toshio Kuratomi a19fa6ba48 Implement feature to return list of files in the archive 10 years ago
Brian Coca a597992592 updated content description to discourage using as a tempalte module 10 years ago
Toshio Kuratomi 761fc8d277 Tar --diff only sends output to stderr if a file is missing. Handle that case
Fixes #1064
10 years ago
Brian Coca 1e026cb8ac find module
updated to be able to get checksums and stat data, also now it only stats a file once so it should be quite faster on large file sets
10 years ago
Matt Martz ba7ad8e7f5 Add version_added for the use_ssh_args option 10 years ago
Matt Martz f431b4817b Add ability to specify using ssh_args in synchronize 10 years ago
Brian Coca de4c7f8ba6 switched to use python's built in os.separator vs using / 10 years ago
Toshio Kuratomi 515cd6666d Fix stat code to return name of group owning the file rather than name of group that the file's owner belongs to.
Followup to #17
10 years ago
Isaac Simmons 1f358721ff Handle ini file properties that contain interpolation errors in the initial values 10 years ago
Brian Coca 7683f36613 fix to return vals docs 10 years ago
James Bowes 1e36b6b7f6 Fix C() formatting typo in file module 10 years ago
Brian Coca 3da0aa9f08 Merge pull request #7 from Ernest0x/patch-1
synchronize: use a single -F instead of -FF
10 years ago
Toshio Kuratomi 559af8d88d Clarify the documented behaviour of insertbefore slightly. 10 years ago
Toshio Kuratomi 8ec43e5bbc Merge pull request #411 from p-tr0/devel
Fix behavior when insert* doesn't match anything
10 years ago
Brian Coca 0cc15866c2 Merge pull request #855 from bcoca/file_rellink_fixes
fixed file module to use realpath when following links,
10 years ago
James Cammarata 4646fdccd9 Merge branch 'feature/ini_file_change_mode_support' of https://github.com/blxd/ansible-modules-core into blxd-feature/ini_file_change_mode_support 10 years ago
Brian Coca 62fa77fbf9 fixed file module to use realpath when following links,
readlink could be relative and fail in corner cases as per #852
10 years ago
gimoh d9f8fa56d8 Do not insert extra newline if line already contains it
When using YAML multi-line strings, e.g.:

- lineinfile:
    dest: /tmp/foo
    line: >
      foo
      bar

the line already ends with a newline.  If an extra newline is appended unconditionally it will lead to inserting an extra newline on each run.
10 years ago
blxd 2c520f31b3 Added check mode support to the ini_file module 10 years ago
Brian Coca dbd8ea1e7d fixed typo on isgid 10 years ago
Brian Coca 6e654f2442 fixed issues with stats return docs as per feedback 10 years ago
Brian Coca 13cdadcc4d removed always for success, as data wont show on fail 10 years ago
Brian Coca cbf42c95b2 draft for documenting module returns 10 years ago
mrsheepuk 410862d631 Doc change - make clearer usage for existing remote file
Having read the doc for this module several times and completely missing that it can be used for existing remote archives, I propose this update to the wording to make clear from the top the two ways in which this module can be used.
10 years ago
Gauvain Pocentek 6c1f40fea7 fetch: fix the flat parameter description
ansible-doc expects the value of the description field to be a list,
otherwise the output is not correct. This patch updates the flat
description to be a list.
10 years ago
Toshio Kuratomi 9e0959d600 Fix for recursion traceback in copy with relative paths
This is a further fix for: https://github.com/ansible/ansible/issues/9092

when the relative path contains a subdirectory.  Like:

ansible localhost -m copy -a 'src=/etc/group dest=foo/bar/'
10 years ago
Toshio Kuratomi 32e8595abf Merge pull request #790 from rhlmhrtr/file_documentation
Fixed Documentation issue concerning file mode
10 years ago
Rahul Mehrotra 98f869f345 Fixed Documentation issue concerning file mode when specified using numberical value 10 years ago
Toshio Kuratomi aa6c73f11b When recursing subdirectories, honor the follow parameter for setting file attributes.
One half of the fix for
https://github.com/ansible/ansible-modules-core/issues/778
The other half is in basic.py
10 years ago
Brian Coca f4dbcea30c Merge pull request #295 from techtonik/patch-3
acl: Fix X support in ACL permissions
10 years ago
Toshio Kuratomi 99a8caf409 Prefer gtar to tar
Fixes #702
10 years ago
sysadmin75 80a5500a23 Fix #10059 - replace module does not obey follow=yes 10 years ago
Toshio Kuratomi 9f333afb6a Standardize class names on Archive suffix.
This also removes the collision between the stdlib ZipFile class and the
module's ZipFile class

Fixes #681
10 years ago
Toshio Kuratomi e3759bd0d3 Add detection of uid,gid,mode changes when deciding whether an archive
needs to be unarchived again.
10 years ago
Toshio Kuratomi 6159b5c423 Implement user,group,mode,selinux settings for unarchive.
This is a partial fix for #234.  Still have to figure out how to
make change reporting work as we can no longer rely on tar's --compare
option
10 years ago
Brian Coca 78cacd0c22 fix for allowing permissions on hard links and soft links + follow=yes 10 years ago
Toshio Kuratomi 022e5274e6 Merge pull request #460 from jbinto/file_allow_touch_hardlink
Files module: Allow touch on hardlinks
10 years ago
Brian Coca 6237dab4cf fix for when state=directory, follow=yes and target is symlink to directory 10 years ago
Toshio Kuratomi c5f7fc93b2 Merge pull request #514 from jbradberry/issue9546
Fix breakage in lineinfile check mode when target file does not exist.
10 years ago
Jeff Bradberry 28375aae7f Fix breakage in lineinfile check mode when target file does not exist.
Similarly to https://github.com/ansible/ansible/issues/6182, checking of the file attributes should be avoided in check mode when the file didn't originally exist.

Also, avoid creating parent directories in check mode.

Fixes https://github.com/ansible/ansible/issues/9546
10 years ago
sysadmin75 0fee1132ad Fixes #9518 - "file state=directory" silently skips if it's currently a file 10 years ago
Brian Coca 242a1562c3 Merge pull request #36 from mscherer/fix_old_9092
Fix old ticket #9092 where a playbook can enter in recursion
10 years ago
Toshio Kuratomi 467ad65f73 Fix documentation formatting 10 years ago
Jesse Buchanan 2d5d7ff542 Files module: Allow touch on hardlinks 10 years ago
Piotr Gosławski a5b1a599e2 update docs for insertbefore/insertafter 10 years ago
follower 5c38ea8374 Note that `rsync` must be installed on both local & remote machine
In particular, if `rsync` is not installed on the remote machine the following error message will be encountered:

    "rsync error: remote command not found"
10 years ago
Brian Coca 4035d24313 Merge pull request #17 from cooniur/devel
Added support of returning owner's group name in stat module
10 years ago
Brian Coca e04ac864a5 Merge pull request #10 from techtonik/patch-1
files.stat: Expose path in returned result
10 years ago
Piotr Gosławski 3c8b4bd4b9 Fix behavior when insert* doesn't match anything
If insertbefore/insertafter didn't match anything, lineinfile module was doing nothing, instead of adding the line at end of fille as it's supposed to.
10 years ago
Eric 87dd3afc91 Fix lineinfile documentation typo 10 years ago
Toshio Kuratomi 19b328c4df Cannot readlink() on a hard link 10 years ago
Brian Coca ee39fd8df0 Merge pull request #124 from jonhadfield/remove-unused-creates
Remove redundant check for creates argument.
10 years ago
Brian Coca 4bc1e46de2 Merge pull request #24 from sysadmind/devel
Added note to files/synchronize module about synchronizing two directori...
10 years ago
Jeff Geerling b9471c9cd5 Add mention of fetch module to the copy module docs. 10 years ago
anatoly techtonik 4f2b99c1e0 acl: Fix X support in ACL permissions
If you try to set rwX permissions, ACL fails to set them at all.

Expected:

    $ sudo setfacl -m 'group::rwX' www
    ...
    drwxrwxr-x  2 root root  4096 Nov 10 17:09 www

With Ansible:

    acl: name=/var/www permissions=rwX etype=group state=present
    ...
    drwxrw-r-x  2 root root  4096 Nov 10 17:30 www

x for group is erased. =/
10 years ago
Toshio Kuratomi 6317d3a988 Move from md5 to sha1 to work on FIPS-140 enabled systems 10 years ago