I have an interesting edge case that I haven’t been able to solve and I was hoping someone smarter than I am had already conquered it.
I have a normal user account on a Linux host with sudo privileges, but my user directory is mounted via NFS (all user directories on all machines are like this). When I run a playbook, I use -u -k -sudo and -K and Ansible has no problem starting up. The script and arguments are copied into ~/.ansible/tmp/ without a problem since my normal user account owns my home directory.
So now the problem …
When Ansible executes sudo, the root account is NOT a user account on the NFS server (and isn’t known to our LDAP/Kerberos authentication), so it is denied permission to read/execute the arguments and script that was copied to the host. Is there some way to force an alternate location for these temporary files? I can create myself a directory in /tmp or elsewhere (not mounted via NFS) just fine but I’m not able to solve the permissions problem without making the .ansible directory world readable/executable.
Thanks,
smoyer