You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ansible配置Windows主机时创建临时目录失败的问题求助

Ansible配置Windows主机时创建临时目录失败的问题求助

大家好,我现在碰到个棘手的问题:我用M1芯片的Mac,通过虚拟机来配置Windows主机,但Ansible一直报错无法创建临时目录,具体错误信息如下:

UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory. 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", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p "echo \~/.ansible/tmp"&& mkdir "echo \~/.ansible/tmp/ansible-tmp-1673021425.449706-14817-109103252041296" && echo ansible-tmp-1673021425.449706-14817-109103252041296="echo \~/.ansible/tmp/ansible-tmp-1673021425.449706-14817-109103252041296" ), exited with result 1", "unreachable": true}

我已经试了好几种办法,但问题依旧:

  • 通过inventory文件配置remote_tmp参数
  • 设置环境变量来指定临时目录路径
  • 分别尝试了SSH和WinRM两种连接方式

之前我配置过其他Windows主机都能正常工作,这次实在摸不着头绪,而且我更想找到解决办法,不想重新创建虚拟机。有没有朋友遇到过类似情况,能给我一些建议吗?

备注:内容来源于stack exchange,提问作者Hugues

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.23 13:23:11