|
|
|
@ -230,7 +230,6 @@ class ActionModule(ActionBase):
|
|
|
|
|
dest, task_vars, follow):
|
|
|
|
|
decrypt = boolean(self._task.args.get('decrypt', True), strict=False)
|
|
|
|
|
force = boolean(self._task.args.get('force', 'yes'), strict=False)
|
|
|
|
|
raw = boolean(self._task.args.get('raw', 'no'), strict=False)
|
|
|
|
|
|
|
|
|
|
result = {}
|
|
|
|
|
result['diff'] = []
|
|
|
|
@ -283,7 +282,7 @@ class ActionModule(ActionBase):
|
|
|
|
|
if local_checksum != dest_status['checksum']:
|
|
|
|
|
# The checksums don't match and we will change or error out.
|
|
|
|
|
|
|
|
|
|
if self._task.diff and not raw:
|
|
|
|
|
if self._task.diff:
|
|
|
|
|
result['diff'].append(self._get_diff_data(dest_file, source_full, task_vars, content))
|
|
|
|
|
|
|
|
|
|
if self._task.check_mode:
|
|
|
|
@ -299,12 +298,7 @@ class ActionModule(ActionBase):
|
|
|
|
|
if suffix:
|
|
|
|
|
tmp_src += suffix
|
|
|
|
|
|
|
|
|
|
remote_path = None
|
|
|
|
|
|
|
|
|
|
if not raw:
|
|
|
|
|
remote_path = self._transfer_file(source_full, tmp_src)
|
|
|
|
|
else:
|
|
|
|
|
self._transfer_file(source_full, dest_file)
|
|
|
|
|
remote_path = self._transfer_file(source_full, tmp_src)
|
|
|
|
|
|
|
|
|
|
# We have copied the file remotely and no longer require our content_tempfile
|
|
|
|
|
self._remove_tempfile_if_content_defined(content, content_tempfile)
|
|
|
|
@ -318,12 +312,7 @@ class ActionModule(ActionBase):
|
|
|
|
|
if remote_path:
|
|
|
|
|
self._fixup_perms2((self._connection._shell.tmpdir, remote_path), execute=False)
|
|
|
|
|
|
|
|
|
|
if raw:
|
|
|
|
|
# Continue to next iteration if raw is defined.
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
# Run the copy module
|
|
|
|
|
|
|
|
|
|
# src and dest here come after original and override them
|
|
|
|
|
# we pass dest only to make sure it includes trailing slash in case of recursive copy
|
|
|
|
|
new_module_args = _create_remote_copy_args(self._task.args)
|
|
|
|
@ -349,9 +338,6 @@ class ActionModule(ActionBase):
|
|
|
|
|
self._remove_tempfile_if_content_defined(content, content_tempfile)
|
|
|
|
|
self._loader.cleanup_tmp_file(source_full)
|
|
|
|
|
|
|
|
|
|
if raw:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
# Fix for https://github.com/ansible/ansible-modules-core/issues/1568.
|
|
|
|
|
# If checksums match, and follow = True, find out if 'dest' is a link. If so,
|
|
|
|
|
# change it to point to the source of the link.
|
|
|
|
|