Changing remote_tmp path to a rooted directory.

Hi! Kinda new to ansible. So I am currently running a playbook using user1 on a remote host host. I am planning to change the remote_tmp directory to /app/ansible/tmp/ (owned by root) and I am having this error.

{“changed”: false, “msg”: “Authentication or permission failure. 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". Failed command was: ( umask 77 && mkdir -p "echo /app/ansible/tmp/ansible-tmp-1563874269.37-78080964197548" && echo ansible-tmp-1563874269.37-78080964197548="echo /app/ansible/tmp/ansible-tmp-1563874269.37-78080964197548" ), exited with result 1”, “unreachable”: true}

Is there a way to change the remote_tmp path to anywhere except /home and /tmp?

you can change in ansible.cft file. here is the example.

https://docs.ansible.com/ansible/2.3/intro_configuration.html#remote-tmp

on the target folder, you can give user permission using chown command.

Thanks,
Ankur