尽管用户是sudo用户,但远程主机在运行Ansible剧本时仍会引发错误。
"/usr/bin/python: can't open file '/home/ludd/.ansible/tmp/ansible-tmp-1466162346.37-16304304631529/zypper'
对我有用的修复是remote_tmp
在ansibles的配置文件中更改ansibles目录的路径,例如
# /etc/ansible/ansible.cfg
remote_tmp = /tmp/${USER}/ansible
数据化的信息可以在这里找到。
注意:可以在一个配置文件中进行并配置Ansible配置设置,该文件将按以下顺序搜索:
ANSIBLE_CONFIG
(如果设置了环境变量) ansible.cfg
(在当前目录中) ~/.ansible.cfg
(在主目录中)/etc/ansible/ansible.cfg
https://docs.ansible.com/ansible/latest/reference_appendices/config.html#the-configuration-file
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句