Authentication or permission failure, did not have permissions on the remote directory

Question:

I am using ansijet to automate the ansible playbook to be run on a button click. The playbook is to stop the running instances on AWS. If run, manually from command-line, the playbook runs well and do the tasks. But when run through the web interface of ansijet, following error is encountered

Following is the ansible.cfg configuration.

I try to change the remote_tmp path to /home/ubuntu/.ansible/tmp
But still getting the same error.

Answer:

By default, the user Ansible connects to remote servers as will be the same name as the user ansible runs as. In the case of Ansijet, it will try to connect to remote servers with whatever user started Ansijet’s node.js process. You can override this by specifying the remote_user in a playbook or globally in the ansible.cfg file.

Ansible will try to create the temp directory if it doesn’t already exist, but will be unable to if that user does not have a home directory or if their home directory permissions do not allow them write access.

I actually changed the temp directory in my ansible.cfg file to point to a location in /tmp which works around these sorts of issues.

remote_tmp = /tmp/.ansible-${USER}/tmp

Leave a Reply