马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?开始注册
x
当我们配置的用户没有家目录执行命令之后,发现以下问题:
" N: e+ t3 U' _; B, u) J+ [$ o说明我们已经更改过ansible下的hosts文件了。) d8 Z) i1 k5 M& Y" w
3 ^: w6 c9 u0 b6 b; z9 b$ ansible -m shell -a "uptime" 192.168.13.5
9 u6 ]" y% r' J: O6 ~+ f' Y5 R& Z X192.168.13.5 | UNREACHABLE! => {
- b' _$ n/ s% r, Z4 @* _+ O "changed": false, 0 ]7 F9 P% W4 g" f& E
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote temp path in ansible.cfg to a path rooted in \"/tmp\". Failed command was: ( umask 77 && mkdir -p \"` echo /home/victor/.ansible/tmp/ansible-tmp-1514033210.52-982392478156 `\" && echo ansible-tmp-1514033210.52-982392478156=\"` echo /home/victor/.ansible/tmp/ansible-tmp-1514033210.52-982392478156 `\" ), exited with result 1",
0 n( \9 K% l J! o9 b* G "unreachable": true
% f' S& F" k$ m9 d W}
/ i# C; X- T1 J/ v
j% F: ~' \1 H4 Y" U& ~( p' p0 R. J解决方法:
- A1 ~% P& E. R" m# _需要修改下ansible.cfg 文件:& C u+ J# \( S# J
. r% o7 N; l' k( U/ s+ F6 g$ sudo vim/etc/ansible/ansible.cfg 将文件配置为/tmp目录下即可:remote_tmp = /tmp/.ansible/tmp 7 ^; C- _9 ~, r) A
, L4 w1 ], M$ q( G
|