清单中某些主机的身份验证或权限失败

时间:2017-07-01 08:35:09

标签: ssh ansible

我有一个大约10个主机的库存,我的Playbook在除2之外的所有主机上运行。我能够从Ansible Server无密码登录这2个主机。但是当我运行playbook甚至是一个简单的ping模块时,我得到错误:

192.168.x.xxx | UNREACHABLE! => {
"changed": false,
"msg": "Authentication or permission failure. In some cases, you may have been able to authenticate and did not have permissions on the remote 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/.ansible/tmp/ansible-tmp-1498895076.45-202255130489130 `\" && echo ansible-tmp-1498895076.45-202255130489130=\"` echo $HOME/.ansible/tmp/ansible-tmp-1498895076.45-202255130489130 `\" ), exited with result 1",
"unreachable": true
}

我已尝试更改nsible.cfg的{​​{1}},更改了https://github.com/ansible/ansible/issues/5725

中建议的连接类型

详细模式输出为:

remote_dir

没有任何帮助。 请帮助我,如何在这2个主机中运行我的剧本?

1 个答案:

答案 0 :(得分:0)

ansible<> 最后添加-s以sudo用户身份运行它