Ansible Failed to set permissions on the temporary

Try to install ACL on remote host, after that execute ansible script

sudo apt-get install acl

As explained in the doc

when both the connection user and the become_user are unprivileged, the module file is written as the user that Ansible connects as (the remote_user), but the file needs to be readable by the user Ansible is set to become. On POSIX systems, Ansible solves this problem in the following way:

First, if setfacl is installed and available in the remote PATH, and the temporary directory on the remote host is mounted with POSIX.1e filesystem ACL support, Ansible will use POSIX ACLs to share the module file with the second unprivileged user.

Next, if POSIX ACLs are not available or setfacl could not be run, Ansible will attempt to change ownership of the module file using chown for systems which support doing so as an unprivileged user

Leave a Comment