diff --git a/lib/ansible/plugins/action/copy.py b/lib/ansible/plugins/action/copy.py index 9a984f03a5..7f11dfda2f 100644 --- a/lib/ansible/plugins/action/copy.py +++ b/lib/ansible/plugins/action/copy.py @@ -43,7 +43,7 @@ class ActionModule(ActionBase): dest = self._task.args.get('dest', None) raw = boolean(self._task.args.get('raw', 'no')) force = boolean(self._task.args.get('force', 'yes')) - faf = task_vars.get('first_available_file', None) + faf = self._task.first_available_file if (source is None and content is None and faf is None) or dest is None: return dict(failed=True, msg="src (or content) and dest are required") diff --git a/lib/ansible/plugins/action/template.py b/lib/ansible/plugins/action/template.py index b8346cb6f9..c13dc32b8a 100644 --- a/lib/ansible/plugins/action/template.py +++ b/lib/ansible/plugins/action/template.py @@ -55,7 +55,7 @@ class ActionModule(ActionBase): source = self._task.args.get('src', None) dest = self._task.args.get('dest', None) - faf = task_vars.get('first_available_file', None) + faf = self._task.first_available_file if (source is None and faf is not None) or dest is None: return dict(failed=True, msg="src and dest are required") diff --git a/test/integration/roles/test_template/tasks/main.yml b/test/integration/roles/test_template/tasks/main.yml index a35b93d9d9..acb6ae9134 100644 --- a/test/integration/roles/test_template/tasks/main.yml +++ b/test/integration/roles/test_template/tasks/main.yml @@ -44,7 +44,7 @@ - name: check what python version ansible is running on command: python -c 'import distutils.sysconfig ; print(distutils.sysconfig.get_python_version())' register: pyver - delegate_to: localhost + #delegate_to: localhost - name: copy known good into place copy: src=foo.txt dest={{output_dir}}/foo.txt