Compare commits

...

3 commits

Author SHA1 Message Date
Mohammed Naser
348b2fcb0b
Merge b12095af90 into f4baa4c6d8 2024-10-03 17:59:19 -04:00
Abhijeet Kasurde
b12095af90 Add changelog fragment
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2024-07-17 15:58:15 -07:00
Mohammed Naser
baea26a137 synchronize: use _find_needle instead 2024-07-17 15:57:04 -07:00
2 changed files with 4 additions and 4 deletions

View file

@ -0,0 +1,3 @@
---
bugfixes:
- synchronize - use _find_needle to find the file in path (https://github.com/ansible-collections/ansible.posix/issues/381).

View file

@ -48,10 +48,7 @@ class ActionModule(ActionBase):
if ':' in path or path.startswith('/'): if ':' in path or path.startswith('/'):
return path return path
if self._task._role is not None: path = self._find_needle('files', path)
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] != '/': if original_path and original_path[-1] == '/' and path[-1] != '/':
# make sure the dwim'd path ends in a trailing "/" # make sure the dwim'd path ends in a trailing "/"