ansible连接远程控制机器出现的问题

UNREACHABLE!: 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 remote_tmp=/tmp/.ansible `"&& mkdir "` echo remote_tmp=/tmp/.ansible/ansible-tmp-1680442520.46-14742-216779377817692 `" && echo ansible-tmp-1680442520.46-14742-216779377817692="` echo remote_tmp=/tmp/.ansible/ansible-tmp-1680442520.46-14742-216779377817692 `" ), exited with result 1

最近在ansible连接控制机器出现的问题,提示用户没有权限创建目录。

1.因为ansible默认配置文件时,会在远程控制用户家目录创建一个临时目录,比如我的用户是tom

这是ansible连接时就会在tom的家目录创建一个.ansible/tmp的目录,但是上面这个报错是没有权限的,这时就很纳闷,会什么会出现这样的情况。

2.登录tom这个用户,但是没发现创建家目录创建.ansible/tmp这个文件,最后删除tom用户,重新换一个用户成功了。

3.最后发现tom的家目录不全,所以创建不了,提示没有对应的权限,最后成功解决。

4.家目录不全,提示

 

UNREACHABLE!: 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 remote_tmp=/tmp/.ansible `"&& mkdir "` echo remote_tmp=/tmp/.ansible/ansible-tmp-1680442520.46-14742-216779377817692 `" && echo ansible-tmp-1680442520.46-14742-216779377817692="` echo remote_tmp=/tmp/.ansible/ansible-tmp-1680442520.46-14742-216779377817692 `" ), exited with result 1

大家执行ansible的时候加上-vvv 可以详细看到保存问题,方便解决

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值