Ben Doherty
87c8a21d16
Don't try to walk over files when building archive
2016-12-08 11:34:37 -05:00
Ben Doherty
42112060b5
Rename 'archive' -> 'arcfile' in compress branch
2016-12-08 11:34:37 -05:00
Ben Doherty
b0211c72d7
Change 'creates' parameter to 'dest'
2016-12-08 11:34:37 -05:00
Ben Doherty
fb03fc8eb1
Refactor zip and tarfile loops together, branch where calls are different
...
This fixed a few bugs and simplified the code
2016-12-08 11:34:37 -05:00
Benjamin Doherty
8fc2a22b4c
Add 'default' to docs for 'compression' option
2016-12-08 11:34:37 -05:00
Ben Doherty
102ee6a3b4
Some refactoring:
...
* rename archive -> arcfile (where it's a file descriptor)
* additional return
* simplify logic around 'archive?' flag
* maintain os separator after arcroot
* use function instead of lambda for filter, ensure file exists before file.cmp'ing it
* track errored files and fail if there are any
2016-12-08 11:34:36 -05:00
Ben Doherty
d4b51adf72
Reword comments slightly
2016-12-08 11:34:36 -05:00
Ben Doherty
e10e1e358c
Documentation updates
2016-12-08 11:34:36 -05:00
Ben Doherty
506f3f68f1
Use different syntax in lambda
2016-12-08 11:34:36 -05:00
Ben Doherty
c9291e06f6
Make remove default to false. It's less frightening.
2016-12-08 11:34:36 -05:00
Ben Doherty
3c8d788c11
Don't use <x> if <y> else <z> syntax
2016-12-08 11:34:36 -05:00
Ben Doherty
c5b9bda656
Accept 'path' as a list argument, expose path and expanded_path,
...
Use correct variable in expanduser
2016-12-08 11:34:36 -05:00
Ben Doherty
2aa3f52bf3
Fix up for zip files and nesting logic.
...
* Don't include the archive in the archive if it falls within an archived path
* If remove=True and the archive would be in an archived path, fail.
* Fix single-file zip file compression
* Add more documentation about 'state' return
2016-12-08 11:34:36 -05:00
Ben Doherty
3be65b66d1
Add license
2016-12-08 11:34:36 -05:00
Ben Doherty
90fdc71728
Add compressed file source to successes when succeeds!
2016-12-08 11:34:36 -05:00
Ben Doherty
bab1f5c082
Add RETURN documentation
2016-12-08 11:34:36 -05:00
Ben Doherty
409f67584e
Fix write mode for ZipFiles ('wb' is invalid!)
2016-12-08 11:34:36 -05:00
Ben Doherty
3465375e42
Drop extra double-quote from documentation
2016-12-08 11:34:36 -05:00
Ben Doherty
2e1ce01dff
Initial commit of extras/archive module.
...
This manages compressed files or archives of many compressed files. You can maintain or update .gz, .bz2 compressed files, .zip archives, or tarballs compressed with gzip or bzip2.
Possible use cases:
* Back up user home directories
* Ensure large text files are always compressed
* Archive trees for distribution
2016-12-08 11:34:36 -05:00
Anton Ovchinnikov
c6ea196a8c
Fix check mode for blockinfile when 'create: yes' is specified ( #2413 )
...
Make the module more semantically similar to lineinfile when
the destination does not exist. This fixes #2021 .
2016-12-08 11:34:34 -05:00
tazle
03be75fa16
Fixed /etc/hosts example for blockinfile ( #2387 )
...
- Fixed name
- Fixed name/ip order in template
2016-12-08 11:34:21 -05:00
dougluce
aaaf37ae41
Don't bomb if original didn't exist ( #2295 )
...
If we don't have an existing file, original ends up as None. Bug
introduced in 70fa125
2016-12-08 11:34:17 -05:00
Michael Scherer
06e3950efb
Port patch.py to python3/python2.4 syntax ( #2276 )
2016-12-08 11:34:16 -05:00
Hans-Joachim Kliemeck
393ea3293c
blockinfile will always add newline at EOF ( #2261 )
2016-12-08 11:34:15 -05:00
Toshio Kuratomi
e95c069aa6
the ansible version constant is now in a different place
2016-12-08 11:34:13 -05:00
Michael Scherer
814efc1418
Use path type for blockinfile 'dest' argument ( #2192 )
2016-12-08 11:34:13 -05:00
Toshio Kuratomi
fda13deb08
Switch blockinfile to using the latest best way to get ansible version
2016-12-08 11:34:11 -05:00
Toshio Kuratomi
07e150779d
Switch from deprecated ANSIBLE_VERSION to ansible.__version__
2016-12-08 11:34:08 -05:00
Michael Scherer
2760c2ded0
Reindent with_items, fix #1849
2016-12-08 11:33:58 -05:00
Toshio Kuratomi
5b84102a15
Doc fixes
2016-12-08 11:33:56 -05:00
Brian Coca
88c946ba4d
added docs to blockinfile with_ interactions
...
fixes #1592
2016-12-08 11:33:50 -05:00
Ritesh Khadgaray
c3e9c54f29
files/blockinfile.py : ERROR: version_added for new option (follow) should be 2.1. Currently 0.0
2016-12-08 11:33:49 -05:00
Brian Coca
4702cc9b1b
added follow docs back, removed from shared
2016-12-08 11:33:49 -05:00
Charles Ferguson
f4a533fa95
Update 'patch' documentation for src, remote_src, backup and binary.
...
The patch module has a few missing items, and inconsistencies, in its
documentation. A few of which are addressed here.
Within Ansible documentation, the choices for boolean values are
commonly 'yes', and 'no'. We standardise the options on that.
'remote_src' documentation uses 'False' and 'True' for its documentation,
so these have been updated in both the choices and default.
'src' documentation refers to 'remote_src', so is updated to use
the 'no' choice.
'backup' did not describe its options and default at all, so we add
them.
'binary' default used 'False', but specified the type as 'bool' which is
implicitly documented as 'yes'/'no', so we make that 'no' as well.
2016-12-08 11:33:48 -05:00
YAEGASHI Takeshi
ae72b7c12c
New module: blockinfile
2016-12-08 11:33:34 -05:00
Robert Buchholz
7c44de7368
patch: Add binary option that maps to --binary to handle CLRF patches
2016-12-08 11:32:58 -05:00
Greg DeKoenigsberg
c65a612d1f
Changes to author formatting, remove emails
2016-12-08 11:32:51 -05:00
Brian Coca
7ccd958ffd
added version added to patch's bacukp
2016-12-08 11:32:47 -05:00
thread13@users.noreply.github.com
5e4a18fcd4
patch module: 'backup_copy' parameter renamed to 'backup'
2016-12-08 11:32:47 -05:00
thread13@users.noreply.github.com
b9ec2ed826
Update patch.py
2016-12-08 11:32:46 -05:00
Brian Coca
a7b46316c1
removed executable bit
2016-12-08 11:32:42 -05:00
Brian Coca
d344a3fde3
more string corrections
2016-12-08 11:32:39 -05:00
Matt Martz
8bd5757720
Fix up modules that have python24 syntax error
2016-12-08 11:32:36 -05:00
Michael Scherer
298e782ff7
Expand user in path, fix #385
2016-12-08 11:32:33 -05:00
Sébastien Gross
47def27127
Update documentation for src parameter.
2016-12-08 11:32:32 -05:00
Sébastien Gross
5f6121856f
Make sure the absolute patch file is passed to the patch command.
...
According the patch(1) manpage:
The --directory option change to the directory dir immediately, before
doing anything else.
Thus if file is not relative to dir and making file absolute ensure that
patch will find it.
2016-12-08 11:32:32 -05:00
Sébastien Gross
4e24d2cdf7
Make sure patch command is found on remote system.
2016-12-08 11:32:32 -05:00
André Luiz dos Santos
f569b512c9
Variable name typo
2016-12-08 11:32:27 -05:00
Brian Coca
60459795b0
added version to patch and remote_src to allow for controlling if src is on master or target
2016-12-08 11:32:25 -05:00
Jakub Jirutka
8383c1c8d3
Add new module "patch"
2016-12-08 11:32:25 -05:00