diff --git a/lib/ansible/runner/action_plugins/copy.py b/lib/ansible/runner/action_plugins/copy.py index 53c0b11325..956946ce24 100644 --- a/lib/ansible/runner/action_plugins/copy.py +++ b/lib/ansible/runner/action_plugins/copy.py @@ -54,6 +54,7 @@ class ActionModule(object): found = False for fn in inject.get('first_available_file'): fn = utils.template(self.runner.basedir, fn, inject) + fn = utils.path_dwim(self.runner.basedir, fn) if os.path.exists(fn): source = fn found = True diff --git a/lib/ansible/runner/action_plugins/template.py b/lib/ansible/runner/action_plugins/template.py index 446baed3aa..ff4ba90599 100644 --- a/lib/ansible/runner/action_plugins/template.py +++ b/lib/ansible/runner/action_plugins/template.py @@ -57,6 +57,7 @@ class ActionModule(object): found = False for fn in self.runner.module_vars.get('first_available_file'): fn = utils.template(self.runner.basedir, fn, inject) + fn = utils.path_dwim(self.runner.basedir, fn) if os.path.exists(fn): source = fn found = True