Add a directory walker to copy

* We need a directory walker that can handle symlinks, empty directories,
  and some other odd needs.  This commit contains a directory walker that
  can do all that.  The walker returns information about the files in the
  directories that we can then use to implement different strategies for
  copying the files to the remote machines.
* Add local_follow parameter to copy that follows local symlinks (follow
  is for remote symlinks)
* Refactor the copying of files out of run into its own method
* Add new integration tests for copy

Fixes #24949
Fixes #21513
This commit is contained in:
Toshio Kuratomi 2017-05-08 22:19:54 -07:00
parent 753a3a03d0
commit f86ce0975d
12 changed files with 1054 additions and 271 deletions

View file

@ -96,7 +96,14 @@ options:
choices: [ "yes", "no" ]
version_added: "1.8"
description:
- 'This flag indicates that filesystem links, if they exist, should be followed.'
- 'This flag indicates that filesystem links in the destination, if they exist, should be followed.'
local_follow:
required: false
default: "yes"
choices: [ "yes", "no" ]
version_added: "2.4"
description:
- 'This flag indicates that filesystem links in the source tree, if they exist, should be followed.'
extends_documentation_fragment:
- files
- validate
@ -273,6 +280,7 @@ def main():
validate = dict(required=False, type='str'),
directory_mode = dict(required=False, type='raw'),
remote_src = dict(required=False, type='bool'),
local_follow = dict(required=False, type='bool'),
),
add_file_common_args=True,
supports_check_mode=True,