From f2abc4cf43af1546d1d03af6714427810a752f61 Mon Sep 17 00:00:00 2001 From: Andrew Makousky Date: Sun, 18 Jun 2017 02:38:17 -0500 Subject: [PATCH] Improve documentation of 'remote_src' in the file copy module. (#23946) Now that remote-to-remote copies are supported in the copy module, the module documentation has been updated to indicate this in the synopsis and examples to make the capability obvious for someone skimming the documentation. --- lib/ansible/modules/files/copy.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/files/copy.py b/lib/ansible/modules/files/copy.py index 47bf40ec75f..d6ec226d697 100644 --- a/lib/ansible/modules/files/copy.py +++ b/lib/ansible/modules/files/copy.py @@ -29,7 +29,8 @@ module: copy version_added: "historical" short_description: Copies files to remote locations. description: - - The C(copy) module copies a file on the local box to remote locations. Use the M(fetch) module to copy files from remote locations to the local box. + - The C(copy) module copies a file from the local or remote machine to a location on the remote machine. + Use the M(fetch) module to copy files from remote locations to the local box. If you need variable interpolation in copied files, use the M(template) module. options: src: @@ -146,6 +147,12 @@ EXAMPLES = ''' src: /mine/sudoers dest: /etc/sudoers validate: 'visudo -cf %s' + +# Copy a "sudoers" file on the remote machine for editing +- copy: + remote_src: true + src: /etc/sudoers + dest: /etc/sudoers.edit ''' RETURN = '''