mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Fix fetch action plugin in v2 to use the inventory_hostname in the dest dir
Fixes #10736
This commit is contained in:
parent
cef93db0a7
commit
d600c65095
1 changed files with 5 additions and 1 deletions
|
@ -94,7 +94,11 @@ class ActionModule(ActionBase):
|
|||
dest = self._loader.path_dwim(dest)
|
||||
else:
|
||||
# files are saved in dest dir, with a subdir for each host, then the filename
|
||||
dest = "%s/%s/%s" % (self._loader.path_dwim(dest), self._connection_info.remote_addr, source_local)
|
||||
if 'inventory_hostname' in task_vars:
|
||||
target_name = task_vars['inventory_hostname']
|
||||
else:
|
||||
target_name = self._connection_info.remote_addr
|
||||
dest = "%s/%s/%s" % (self._loader.path_dwim(dest), target_name, source_local)
|
||||
|
||||
dest = dest.replace("//","/")
|
||||
|
||||
|
|
Loading…
Reference in a new issue