Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.ansible/tmp/ansible-tmp-* Permission denied

Tags:

ansible

Remote host throws error while running Ansible playbook despite a user being sudo user.

"/usr/bin/python: can't open file '/home/ludd/.ansible/tmp/ansible-tmp-1466162346.37-16304304631529/zypper'
like image 409
Lukasz Dynowski Avatar asked Jun 17 '16 11:06

Lukasz Dynowski


1 Answers

A fix that worked for me, was to change the path of the ansibles' remote_tmp directory, in ansibles' configuration file, e.g.

# /etc/ansible/ansible.cfg
remote_tmp      = /tmp/${USER}/ansible

Datailed information can be found here.

Note: With ansible v4 (or later) this this variable might look like this ansible_remote_tmp check the docs

Caution:Ansible Configuration Settings can be made and used in a configuration file which will be searched for in the following order:

  • ANSIBLE_CONFIG (environment variable if set)
  • ansible.cfg (in the current directory)
  • ~/.ansible.cfg (in the home directory)
  • /etc/ansible/ansible.cfg
like image 177
Lukasz Dynowski Avatar answered Oct 21 '22 13:10

Lukasz Dynowski