mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 05:40:23 -07:00
template: change to pass along the correct template path (#35027)
* template: change to pass along the correct template path * standardise tmp path behaviour * removed if condition as it should not be needed
This commit is contained in:
parent
676ce74cbf
commit
389f4ef1fb
12 changed files with 41 additions and 25 deletions
|
@ -258,7 +258,7 @@ class ActionModule(ActionBase):
|
|||
return result
|
||||
|
||||
# Define a remote directory that we will copy the file to.
|
||||
tmp_src = self._connection._shell.join_path(self._connection._shell.tempdir, 'source')
|
||||
tmp_src = self._connection._shell.join_path(tmp, 'source')
|
||||
|
||||
remote_path = None
|
||||
|
||||
|
@ -273,7 +273,7 @@ class ActionModule(ActionBase):
|
|||
|
||||
# fix file permissions when the copy is done as a different user
|
||||
if remote_path:
|
||||
self._fixup_perms2((self._connection._shell.tempdir, remote_path))
|
||||
self._fixup_perms2((tmp, remote_path))
|
||||
|
||||
if raw:
|
||||
# Continue to next iteration if raw is defined.
|
||||
|
@ -389,8 +389,7 @@ class ActionModule(ActionBase):
|
|||
|
||||
result = super(ActionModule, self).run(tmp, task_vars)
|
||||
|
||||
if tmp is None:
|
||||
tmp = self._connection._shell.tempdir
|
||||
tmp = self._connection._shell.tempdir
|
||||
|
||||
source = self._task.args.get('src', None)
|
||||
content = self._task.args.get('content', None)
|
||||
|
@ -548,6 +547,6 @@ class ActionModule(ActionBase):
|
|||
result.update(dict(dest=dest, src=source, changed=changed))
|
||||
|
||||
# Delete tmp path
|
||||
self._remove_tmp_path(self._connection._shell.tempdir)
|
||||
self._remove_tmp_path(tmp)
|
||||
|
||||
return result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue