.ansible/tmp/ansible-tmp-* 权限被拒绝 [英] .ansible/tmp/ansible-tmp-* Permission denied
问题描述
尽管用户是 sudo 用户,但远程主机在运行 Ansible playbook 时仍会引发错误.
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'
推荐答案
对我有用的修复是更改 ansibles 的 remote_tmp
目录的路径,在 ansibles 的配置文件中,例如
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.
注意:在 ansible v4(或更高版本)中,此变量可能如下所示 ansible_remote_tmp
检查 docs
Note: With ansible v4 (or later) this this variable might look like this ansible_remote_tmp
check the docs
注意:可以在配置文件中进行Ansible配置设置并使用该文件将在以下顺序:
Caution:Ansible Configuration Settings can be made and used in a configuration file which will be searched for in the following order:
ANSIBLE_CONFIG
(如果设置了环境变量)ansible.cfg
(在当前目录下)~/.ansible.cfg
(在主目录中)/etc/ansible/ansible.cfg
ANSIBLE_CONFIG
(environment variable if set)ansible.cfg
(in the current directory)~/.ansible.cfg
(in the home directory)/etc/ansible/ansible.cfg
这篇关于.ansible/tmp/ansible-tmp-* 权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!