mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-03 04:34:24 -07:00
added diff to assemble for remote_src=false
This commit is contained in:
parent
f048aca5f6
commit
1b7369cc8d
1 changed files with 7 additions and 11 deletions
|
@ -110,17 +110,13 @@ class ActionModule(ActionBase):
|
||||||
dest = self._remote_expand_user(dest, tmp)
|
dest = self._remote_expand_user(dest, tmp)
|
||||||
remote_checksum = self._remote_checksum(tmp, dest, all_vars=task_vars)
|
remote_checksum = self._remote_checksum(tmp, dest, all_vars=task_vars)
|
||||||
|
|
||||||
|
diff = {}
|
||||||
if path_checksum != remote_checksum:
|
if path_checksum != remote_checksum:
|
||||||
resultant = file(path).read()
|
resultant = file(path).read()
|
||||||
# FIXME: diff needs to be moved somewhere else
|
|
||||||
#if self.runner.diff:
|
if self._play_context.diff:
|
||||||
# dest_result = self._execute_module(module_name='slurp', module_args=dict(path=dest), task_vars=task_vars, tmp=tmp, persist_files=True)
|
diff = self._get_diff_data(tmp, dest, path, task_vars)
|
||||||
# if 'content' in dest_result:
|
|
||||||
# dest_contents = dest_result['content']
|
|
||||||
# if dest_result['encoding'] == 'base64':
|
|
||||||
# dest_contents = base64.b64decode(dest_contents)
|
|
||||||
# else:
|
|
||||||
# raise Exception("unknown encoding, failed: %s" % dest_result)
|
|
||||||
xfered = self._transfer_data('src', resultant)
|
xfered = self._transfer_data('src', resultant)
|
||||||
|
|
||||||
# fix file permissions when the copy is done as a different user
|
# fix file permissions when the copy is done as a different user
|
||||||
|
@ -139,8 +135,8 @@ class ActionModule(ActionBase):
|
||||||
)
|
)
|
||||||
|
|
||||||
res = self._execute_module(module_name='copy', module_args=new_module_args, task_vars=task_vars, tmp=tmp)
|
res = self._execute_module(module_name='copy', module_args=new_module_args, task_vars=task_vars, tmp=tmp)
|
||||||
# FIXME: diff stuff
|
if diff:
|
||||||
#res.diff = dict(after=resultant)
|
res['diff'] = diff
|
||||||
return res
|
return res
|
||||||
else:
|
else:
|
||||||
new_module_args = self._task.args.copy()
|
new_module_args = self._task.args.copy()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue