made sure they all look in files/vars/template dirs also when executed in play and not only from task
This commit is contained in:
parent
861fdfc5ba
commit
950622cebd
8 changed files with 13 additions and 9 deletions
|
@ -96,8 +96,7 @@ class ActionModule(ActionBase):
|
|||
elif self._task._role is not None:
|
||||
src = self._loader.path_dwim_relative(self._task._role._role_path, 'files', src)
|
||||
else:
|
||||
# the source is local, so expand it here
|
||||
src = self._loader.path_dwim(os.path.expanduser(src))
|
||||
src = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', src)
|
||||
|
||||
_re = None
|
||||
if regexp is not None:
|
||||
|
|
|
@ -88,7 +88,7 @@ class ActionModule(ActionBase):
|
|||
if self._task._role is not None:
|
||||
source = self._loader.path_dwim_relative(self._task._role._role_path, 'files', source)
|
||||
else:
|
||||
source = self._loader.path_dwim(source)
|
||||
source = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', source)
|
||||
|
||||
# A list of source file tuples (full_path, relative_path) which will try to copy to the destination
|
||||
source_files = []
|
||||
|
|
|
@ -36,7 +36,7 @@ class ActionModule(ActionBase):
|
|||
if self._task._role:
|
||||
source = self._loader.path_dwim_relative(self._task._role._role_path, 'vars', source)
|
||||
else:
|
||||
source = self._loader.path_dwim(source)
|
||||
source = self._loader.path_dwim_relative(self._loader.get_basedir(), 'vars', source)
|
||||
|
||||
if os.path.exists(source):
|
||||
(data, show_content) = self._loader._get_file_contents(source)
|
||||
|
|
|
@ -41,7 +41,7 @@ class ActionModule(ActionBase):
|
|||
if self._task._role is not None:
|
||||
src = self._loader.path_dwim_relative(self._task._role._role_path, 'files', src)
|
||||
else:
|
||||
src = self._loader.path_dwim(src)
|
||||
src = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', src)
|
||||
|
||||
# create the remote tmp dir if needed, and put the source file there
|
||||
if tmp is None or "-tmp-" not in tmp:
|
||||
|
|
|
@ -65,7 +65,7 @@ class ActionModule(ActionBase):
|
|||
if self._task._role is not None:
|
||||
source = self._loader.path_dwim_relative(self._task._role._role_path, 'files', source)
|
||||
else:
|
||||
source = self._loader.path_dwim(source)
|
||||
source = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', source)
|
||||
|
||||
# transfer the file to a remote tmp location
|
||||
tmp_src = self._connection._shell.join_path(tmp, os.path.basename(source))
|
||||
|
|
|
@ -31,7 +31,12 @@ class ActionModule(ActionBase):
|
|||
def _get_absolute_path(self, path):
|
||||
if self._task._role is not None:
|
||||
original_path = path
|
||||
|
||||
if self._task._role is not None:
|
||||
path = self._loader.path_dwim_relative(self._task._role._role_path, 'files', path)
|
||||
else:
|
||||
path = self._loader.path_dwim_relative(self._loader.get_basedir(), 'files', path)
|
||||
|
||||
if original_path and original_path[-1] == '/' and path[-1] != '/':
|
||||
# make sure the dwim'd path ends in a trailing "/"
|
||||
# if the original path did
|
||||
|
|
|
@ -71,7 +71,7 @@ class ActionModule(ActionBase):
|
|||
if self._task._role is not None:
|
||||
source = self._loader.path_dwim_relative(self._task._role._role_path, 'templates', source)
|
||||
else:
|
||||
source = self._loader.path_dwim(source)
|
||||
source = self._loader.path_dwim_relative(self._loader.get_basedir(), 'templates', source)
|
||||
|
||||
# Expand any user home dir specification
|
||||
dest = self._remote_expand_user(dest, tmp)
|
||||
|
|
|
@ -64,7 +64,7 @@ class ActionModule(ActionBase):
|
|||
if self._task._role is not None:
|
||||
source = self._loader.path_dwim_relative(self._task._role._role_path, 'files', source)
|
||||
else:
|
||||
source = self._loader.path_dwim(source)
|
||||
source = self._loader.path_dwim_relative(tself._loader.get_basedir(), 'files', source)
|
||||
|
||||
remote_checksum = self._remote_checksum(tmp, dest, all_vars=task_vars)
|
||||
if remote_checksum != '3':
|
||||
|
|
Loading…
Reference in a new issue