Learn how to configure and troubleshoot the Ansible remote temp directory for different environments including restricted and shared systems.
If you depend on using Ansible with a config file in the current working directory, the best way to avoid this problem is to restrict access to your Ansible directories to particular user (s) and/or group (s).
When those tasks run, they use the same remote_tmp directory setup from the ansible.cfg. However, due to permissions and directory size issues, I need to change the remote_tmp directory for tasks that I am using delegate_to for.
I might have had a similar issue connecting from Linux to Windows. I needed to configure the ansible_shell_type in the --extra-vars of the call to be successful as I've described here: stackoverflow.com/a/67366164/406423 - does this help?
This module is part of ansible-core and included in all Ansible installations. In most cases, you can use the short module name tempfile even without specifying the collections keyword.
ansible.cfg controls Ansible's behavior — inventory location, SSH settings, privilege escalation, performance tuning, and more. Place it in your project directory for per-project configuration.
The fix is usually configuring remote_tmpto point to a writable directory, enabling pipelining to bypass the temp directory, or pre-creating the directory with the rawmodule.
In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp".
In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in "/tmp".