Now I have seen an issue in the Ansible github with the same problem:
https://github.com/ansible/ansible/issues/6948It provides a patch to solve the error, but it only changes the error message.
The original error was:
TASK: [copy src=/tmp/root.txt dest=/tmp/pr.txt] *******************************
fatal: [158.42.104.90] => Traceback (most recent call last):
File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 532, in _executor
exec_rc = self._executor_internal(host, new_stdin)
File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 629, in _executor_internal
return self._executor_internal_inner(host, self.module_name, self.module_args, inject, port, complex_args=complex_args)
File "/usr/lib/pymodules/python2.7/ansible/runner/__init__.py", line 815, in _executor_internal_inner
result = handler.run(conn, tmp, module_name, module_args, inject, complex_args)
File "/usr/lib/pymodules/python2.7/ansible/runner/action_plugins/copy.py", line 158, in run
local_md5 = utils.md5(source_full)
File "/usr/lib/pymodules/python2.7/ansible/utils/__init__.py", line 570, in md5
infile = open(filename, 'rb')
IOError: [Errno 13] Permission denied: u'/tmp/root.txt'
The error with the patch provided in the issues is:
TASK: [copy src=/tmp/root.txt dest=/tmp/pr.txt] *******************************
fatal:
[158.42.104.90] => error while accessing the file /tmp/root.txt,
error was: [Errno 13] Permission denied: u'/tmp/root.txt'