From 22d50a3903d507f774570f564a546d785f840d8d Mon Sep 17 00:00:00 2001 From: Mohammed Naser Date: Tue, 21 Mar 2023 18:46:25 -0400 Subject: [PATCH 1/2] synchronize: use _find_needle instead --- plugins/action/synchronize.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/plugins/action/synchronize.py b/plugins/action/synchronize.py index a171a2b..b3a7ce9 100644 --- a/plugins/action/synchronize.py +++ b/plugins/action/synchronize.py @@ -48,10 +48,7 @@ class ActionModule(ActionBase): if ':' in path or path.startswith('/'): return 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) + path = self._find_needle('files', path) if original_path and original_path[-1] == '/' and path[-1] != '/': # make sure the dwim'd path ends in a trailing "/" From e31700d993552a1364db31142226afd58c4d5849 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Wed, 17 Jul 2024 15:58:15 -0700 Subject: [PATCH 2/2] Add changelog fragment Signed-off-by: Abhijeet Kasurde --- changelogs/fragments/synchronize.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/synchronize.yml diff --git a/changelogs/fragments/synchronize.yml b/changelogs/fragments/synchronize.yml new file mode 100644 index 0000000..d49e6f1 --- /dev/null +++ b/changelogs/fragments/synchronize.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - synchronize - use _find_needle to find the file in path (https://github.com/ansible-collections/ansible.posix/issues/381).