|
|
@ -37,6 +37,8 @@ class ActionModule(ActionBase):
|
|
|
|
|
|
|
|
|
|
|
|
result = super(ActionModule, self).run(tmp, task_vars)
|
|
|
|
result = super(ActionModule, self).run(tmp, task_vars)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tmp = self._connection._shell.tempdir
|
|
|
|
|
|
|
|
|
|
|
|
source = self._task.args.get('src', None)
|
|
|
|
source = self._task.args.get('src', None)
|
|
|
|
dest = self._task.args.get('dest', None)
|
|
|
|
dest = self._task.args.get('dest', None)
|
|
|
|
remote_src = boolean(self._task.args.get('remote_src', False), strict=False)
|
|
|
|
remote_src = boolean(self._task.args.get('remote_src', False), strict=False)
|
|
|
@ -83,7 +85,7 @@ class ActionModule(ActionBase):
|
|
|
|
|
|
|
|
|
|
|
|
if not remote_src:
|
|
|
|
if not remote_src:
|
|
|
|
# transfer the file to a remote tmp location
|
|
|
|
# transfer the file to a remote tmp location
|
|
|
|
tmp_src = self._connection._shell.join_path(self._connection._shell.tempdir, 'source')
|
|
|
|
tmp_src = self._connection._shell.join_path(tmp, 'source')
|
|
|
|
self._transfer_file(source, tmp_src)
|
|
|
|
self._transfer_file(source, tmp_src)
|
|
|
|
|
|
|
|
|
|
|
|
# handle diff mode client side
|
|
|
|
# handle diff mode client side
|
|
|
@ -91,7 +93,7 @@ class ActionModule(ActionBase):
|
|
|
|
|
|
|
|
|
|
|
|
if not remote_src:
|
|
|
|
if not remote_src:
|
|
|
|
# fix file permissions when the copy is done as a different user
|
|
|
|
# fix file permissions when the copy is done as a different user
|
|
|
|
self._fixup_perms2((self._connection._shell.tempdir, tmp_src))
|
|
|
|
self._fixup_perms2((tmp, tmp_src))
|
|
|
|
# Build temporary module_args.
|
|
|
|
# Build temporary module_args.
|
|
|
|
new_module_args = self._task.args.copy()
|
|
|
|
new_module_args = self._task.args.copy()
|
|
|
|
new_module_args.update(
|
|
|
|
new_module_args.update(
|
|
|
@ -119,5 +121,5 @@ class ActionModule(ActionBase):
|
|
|
|
except AnsibleAction as e:
|
|
|
|
except AnsibleAction as e:
|
|
|
|
result.update(e.result)
|
|
|
|
result.update(e.result)
|
|
|
|
finally:
|
|
|
|
finally:
|
|
|
|
self._remove_tmp_path(self._connection._shell.tempdir)
|
|
|
|
self._remove_tmp_path(tmp)
|
|
|
|
return result
|
|
|
|
return result
|
|
|
|